From 7ca7a56c5e887c53878757d0361401e37f0d8371 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 27 Mar 2024 04:12:13 +0000 Subject: [PATCH] Release v0.2.23 --- pyproject.toml | 2 +- src/superagent/__init__.py | 2 ++ src/superagent/core/client_wrapper.py | 2 +- src/superagent/types/__init__.py | 2 ++ .../types/app_models_request_datasource.py | 4 ++++ .../types/embeddings_model_provider.py | 21 +++++++++++++++++++ src/superagent/types/tool_type.py | 8 +++++++ 7 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 src/superagent/types/embeddings_model_provider.py diff --git a/pyproject.toml b/pyproject.toml index de99c13..53b14f0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "superagent-py" -version = "v0.2.22" +version = "v0.2.23" description = "" readme = "README.md" authors = [] diff --git a/src/superagent/__init__.py b/src/superagent/__init__.py index 26869a3..964d5e9 100644 --- a/src/superagent/__init__.py +++ b/src/superagent/__init__.py @@ -28,6 +28,7 @@ DatasourceList, DatasourceStatus, DatasourceType, + EmbeddingsModelProvider, FunctionDefinition, HttpValidationError, LlmList, @@ -96,6 +97,7 @@ "DatasourceList", "DatasourceStatus", "DatasourceType", + "EmbeddingsModelProvider", "FunctionDefinition", "HttpValidationError", "LlmList", diff --git a/src/superagent/core/client_wrapper.py b/src/superagent/core/client_wrapper.py index bbb08a4..cab6325 100644 --- a/src/superagent/core/client_wrapper.py +++ b/src/superagent/core/client_wrapper.py @@ -16,7 +16,7 @@ def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { "X-Fern-Language": "Python", "X-Fern-SDK-Name": "superagent-py", - "X-Fern-SDK-Version": "v0.2.22", + "X-Fern-SDK-Version": "v0.2.23", } token = self._get_token() if token is not None: diff --git a/src/superagent/types/__init__.py b/src/superagent/types/__init__.py index 35efa29..6f99f0a 100644 --- a/src/superagent/types/__init__.py +++ b/src/superagent/types/__init__.py @@ -27,6 +27,7 @@ from .datasource_list import DatasourceList from .datasource_status import DatasourceStatus from .datasource_type import DatasourceType +from .embeddings_model_provider import EmbeddingsModelProvider from .function_definition import FunctionDefinition from .http_validation_error import HttpValidationError from .llm_list import LlmList @@ -93,6 +94,7 @@ "DatasourceList", "DatasourceStatus", "DatasourceType", + "EmbeddingsModelProvider", "FunctionDefinition", "HttpValidationError", "LlmList", diff --git a/src/superagent/types/app_models_request_datasource.py b/src/superagent/types/app_models_request_datasource.py index c74a478..1209e25 100644 --- a/src/superagent/types/app_models_request_datasource.py +++ b/src/superagent/types/app_models_request_datasource.py @@ -4,6 +4,7 @@ import typing from ..core.datetime_utils import serialize_datetime +from .embeddings_model_provider import EmbeddingsModelProvider try: import pydantic.v1 as pydantic # type: ignore @@ -19,6 +20,9 @@ class AppModelsRequestDatasource(pydantic.BaseModel): url: typing.Optional[str] = None metadata: typing.Optional[typing.Dict[str, typing.Any]] = None vector_db_id: typing.Optional[str] = pydantic.Field(alias="vectorDbId", default=None) + embeddings_model_provider: typing.Optional[EmbeddingsModelProvider] = pydantic.Field( + alias="embeddingsModelProvider", default=None + ) def json(self, **kwargs: typing.Any) -> str: kwargs_with_defaults: typing.Any = {"by_alias": True, "exclude_unset": True, **kwargs} diff --git a/src/superagent/types/embeddings_model_provider.py b/src/superagent/types/embeddings_model_provider.py new file mode 100644 index 0000000..fd2ca49 --- /dev/null +++ b/src/superagent/types/embeddings_model_provider.py @@ -0,0 +1,21 @@ +# This file was auto-generated by Fern from our API Definition. + +import enum +import typing + +T_Result = typing.TypeVar("T_Result") + + +class EmbeddingsModelProvider(str, enum.Enum): + """ + An enumeration. + """ + + OPENAI = "OPENAI" + AZURE_OPENAI = "AZURE_OPENAI" + + def visit(self, openai: typing.Callable[[], T_Result], azure_openai: typing.Callable[[], T_Result]) -> T_Result: + if self is EmbeddingsModelProvider.OPENAI: + return openai() + if self is EmbeddingsModelProvider.AZURE_OPENAI: + return azure_openai() diff --git a/src/superagent/types/tool_type.py b/src/superagent/types/tool_type.py index f202eba..96c7b42 100644 --- a/src/superagent/types/tool_type.py +++ b/src/superagent/types/tool_type.py @@ -31,6 +31,8 @@ class ToolType(str, enum.Enum): HTTP = "HTTP" SUPERRAG = "SUPERRAG" RESEARCH = "RESEARCH" + GITHUB = "GITHUB" + SCRAPER = "SCRAPER" def visit( self, @@ -54,6 +56,8 @@ def visit( http: typing.Callable[[], T_Result], superrag: typing.Callable[[], T_Result], research: typing.Callable[[], T_Result], + github: typing.Callable[[], T_Result], + scraper: typing.Callable[[], T_Result], ) -> T_Result: if self is ToolType.ALGOLIA: return algolia() @@ -95,3 +99,7 @@ def visit( return superrag() if self is ToolType.RESEARCH: return research() + if self is ToolType.GITHUB: + return github() + if self is ToolType.SCRAPER: + return scraper()