Skip to content

Commit

Permalink
feat(integrations): added arxiv + updated readme/llamaparse/cloudinary
Browse files Browse the repository at this point in the history
  • Loading branch information
Vedantsahai18 committed Nov 27, 2024
1 parent 8c4db9b commit 34aba82
Show file tree
Hide file tree
Showing 19 changed files with 2,179 additions and 1,603 deletions.
22 changes: 13 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1402,7 +1402,7 @@ output:
```yaml
arguments:
query: string # The search query string
load_max_docs: integer # Maximum number of documents to load (default: 2)
load_max_docs: integer # (Optional) Maximum number of documents to load. Default is 2.
output:
documents: list # The documents returned from the Wikipedia search
Expand Down Expand Up @@ -1443,10 +1443,13 @@ output:
```yaml
setup:
llamaparse_api_key: string # The API key for Llama Parse
params: dict # (Optional) Additional parameters for the Llama Parse integration
arguments:
file: string # The base64 encoded file to parse
filename: string # The filename of the file
file: string | Array<string> # The base64 encoded file to parse or an array of URLs to load.
filename: string # (Optional). The filename of the file. Default is a random UUID. Only used if file is a base64 encoded string.
params: dict # (Optional) Additional parameters for the Llama Parse integration. Overrides the setup parameters.
base64: boolean # Whether the input file is base64 encoded. Default is false.
output:
documents: list # The parsed data from the document
Expand All @@ -1468,20 +1471,21 @@ setup:
cloudinary_cloud_name: string # Your Cloudinary cloud name
cloudinary_api_key: string # Your Cloudinary API key
cloudinary_api_secret: string # Your Cloudinary API secret
params: dict # (Optional) Additional parameters for the Cloudinary integration
arguments:
file: string # The URL of the file upload. Only available for media_upload method.
upload_params: dict # Additional parameters for the upload. Only available for media_upload method.
public_id: string # The public ID for the file. For media_edit method it is MANDATORY. For media_upload method it is optional.
transformation: list[dict] # The transformations to apply to the file
return_base64: boolean # Whether to return the file in base64 encoding
upload_params: dict # (Optional) Additional parameters for the upload. Only available for media_upload method.
public_id: string # (Optional) The public ID for the file. For media_edit method it is MANDATORY. For media_upload method it is optional. Default is a random UUID.
transformation: list[dict] # The transformations to apply to the file. Only available for media_edit method.
return_base64: boolean # Whether to return the file in base64 encoding. Default is false.
output:
url: string # The URL of the uploaded file. Only available for media_upload method.
meta_data: dict # Additional metadata from the upload response. Only available for media_upload method.
public_id: string # The public ID of the uploaded file. Only available for media_upload method.
transformed_url: string # The transformed URL. Only available for media_edit method.
base64: string # The base64 encoded file. Only available for media_edit method.
transformed_url: string # (Optional) The transformed URL. Only available for media_edit method.
base64: string # (Optional) The base64 encoded file if return_base64 is true.
```

</td>
Expand Down
1 change: 1 addition & 0 deletions agents-api/agents_api/autogen/Tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from pydantic import AwareDatetime, BaseModel, ConfigDict, Field, StrictBool

from .Chat import ChatSettings
from .Common import JinjaTemplate
from .Tools import (
ChosenBash20241022,
ChosenComputer20241022,
Expand Down
183 changes: 151 additions & 32 deletions agents-api/agents_api/autogen/Tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
BaseModel,
ConfigDict,
Field,
RootModel,
StrictBool,
)

Expand Down Expand Up @@ -147,6 +148,74 @@ class ApiCallDefUpdate(BaseModel):
"""


class ArxivSearchArguments(BaseModel):
"""
Arguments for Arxiv Search
"""

model_config = ConfigDict(
populate_by_name=True,
)
query: str
"""
The search query for searching with Arxiv
"""
id_list: list[str] | None = None
"""
The list of Arxiv IDs to search with
"""
max_results: Annotated[int, Field(ge=1, le=300000)] = 10
"""
The maximum number of results to return
"""
download_pdf: StrictBool = False
"""
The download the pdf of the results
"""
sort_by: Literal["relevance", "lastUpdatedDate", "submittedDate"] = "relevance"
"""
The sort criterion for the results
"""
sort_order: Literal["ascending", "descending"] = "descending"
"""
The sort order for the results
"""


class ArxivSearchArgumentsUpdate(BaseModel):
"""
Arguments for Arxiv Search
"""

model_config = ConfigDict(
populate_by_name=True,
)
query: str | None = None
"""
The search query for searching with Arxiv
"""
id_list: list[str] | None = None
"""
The list of Arxiv IDs to search with
"""
max_results: Annotated[int, Field(ge=1, le=300000)] = 10
"""
The maximum number of results to return
"""
download_pdf: StrictBool = False
"""
The download the pdf of the results
"""
sort_by: Literal["relevance", "lastUpdatedDate", "submittedDate"] = "relevance"
"""
The sort criterion for the results
"""
sort_order: Literal["ascending", "descending"] = "descending"
"""
The sort order for the results
"""


class BaseChosenToolCall(BaseModel):
"""
The response tool value generated by the model
Expand Down Expand Up @@ -200,6 +269,7 @@ class BaseIntegrationDef(BaseModel):
"llama_parse",
"ffmpeg",
"cloudinary",
"arxiv",
]
"""
The provider of the integration
Expand Down Expand Up @@ -239,6 +309,7 @@ class BaseIntegrationDefUpdate(BaseModel):
"llama_parse",
"ffmpeg",
"cloudinary",
"arxiv",
]
| None
) = None
Expand Down Expand Up @@ -886,6 +957,7 @@ class CreateToolRequest(BaseModel):
| FfmpegIntegrationDef
| CloudinaryUploadIntegrationDef
| CloudinaryEditIntegrationDef
| ArxivIntegrationDef
| None
) = None
"""
Expand Down Expand Up @@ -1209,29 +1281,21 @@ class LlamaParseFetchArguments(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
result_format: Literal["text", "markdown"] = "text"
"""
The format of the result. Can be "text" or "markdown". Default is "text".
"""
num_workers: Annotated[int, Field(ge=1, le=10)] = 2
"""
Number of workers for parallel processing. Default is 2, but can be set between 1 and 10.
"""
verbose: StrictBool = True
filename: str | None = None
"""
Verbose mode for detailed logging. Default is true.
File Name. If not provided, a random name will be generated.
"""
language: str = "en"
file: str | list[str]
"""
Language of the text. Default is English.
The base64 string of the file, which can be a single string or a list of strings
"""
filename: str | None = None
params: dict[str, Any] | None = None
"""
File Name. If not provided, a random name will be generated.
Optional upload parameters
"""
file: str
base64: StrictBool = False
"""
The base64 string of the file
The input file is base64
"""


Expand All @@ -1243,29 +1307,21 @@ class LlamaParseFetchArgumentsUpdate(BaseModel):
model_config = ConfigDict(
populate_by_name=True,
)
result_format: Literal["text", "markdown"] = "text"
"""
The format of the result. Can be "text" or "markdown". Default is "text".
"""
num_workers: Annotated[int, Field(ge=1, le=10)] = 2
"""
Number of workers for parallel processing. Default is 2, but can be set between 1 and 10.
"""
verbose: StrictBool = True
filename: str | None = None
"""
Verbose mode for detailed logging. Default is true.
File Name. If not provided, a random name will be generated.
"""
language: str = "en"
file: str | list[str] | None = None
"""
Language of the text. Default is English.
The base64 string of the file, which can be a single string or a list of strings
"""
filename: str | None = None
params: dict[str, Any] | None = None
"""
File Name. If not provided, a random name will be generated.
Optional upload parameters
"""
file: str | None = None
base64: StrictBool = False
"""
The base64 string of the file
The input file is base64
"""


Expand Down Expand Up @@ -1333,6 +1389,10 @@ class LlamaParseSetup(BaseModel):
"""
The API key for LlamaParse
"""
params: dict[str, Any] | None = None
"""
Optional upload parameters
"""


class LlamaParseSetupUpdate(BaseModel):
Expand All @@ -1347,6 +1407,10 @@ class LlamaParseSetupUpdate(BaseModel):
"""
The API key for LlamaParse
"""
params: dict[str, Any] | None = None
"""
Optional upload parameters
"""


class NamedToolChoice(BaseModel):
Expand Down Expand Up @@ -1411,6 +1475,7 @@ class PatchToolRequest(BaseModel):
| FfmpegIntegrationDefUpdate
| CloudinaryUploadIntegrationDefUpdate
| CloudinaryEditIntegrationDefUpdate
| ArxivIntegrationDefUpdate
| None
) = None
"""
Expand Down Expand Up @@ -1838,6 +1903,7 @@ class Tool(BaseModel):
| FfmpegIntegrationDef
| CloudinaryUploadIntegrationDef
| CloudinaryEditIntegrationDef
| ArxivIntegrationDef
| None
) = None
"""
Expand Down Expand Up @@ -1931,6 +1997,7 @@ class UpdateToolRequest(BaseModel):
| FfmpegIntegrationDef
| CloudinaryUploadIntegrationDef
| CloudinaryEditIntegrationDef
| ArxivIntegrationDef
| None
) = None
"""
Expand Down Expand Up @@ -2148,6 +2215,58 @@ class WikipediaSearchArgumentsUpdate(BaseModel):
"""


class ArxivIntegrationDef(BaseIntegrationDef):
"""
Arxiv integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["arxiv"] = "arxiv"
"""
The provider must be "arxiv"
"""
method: str | None = None
"""
The specific method of the integration to call
"""
setup: Any | None = None
"""
The setup parameters for Arxiv
"""
arguments: ArxivSearchArguments | None = None
"""
The arguments for Arxiv Search
"""


class ArxivIntegrationDefUpdate(BaseIntegrationDefUpdate):
"""
Arxiv integration definition
"""

model_config = ConfigDict(
populate_by_name=True,
)
provider: Literal["arxiv"] = "arxiv"
"""
The provider must be "arxiv"
"""
method: str | None = None
"""
The specific method of the integration to call
"""
setup: Any | None = None
"""
The setup parameters for Arxiv
"""
arguments: ArxivSearchArgumentsUpdate | None = None
"""
The arguments for Arxiv Search
"""


class BaseBrowserbaseIntegrationDef(BaseIntegrationDef):
"""
The base definition for a browserbase integration
Expand Down
Loading

0 comments on commit 34aba82

Please sign in to comment.