From 8cfc1816deea32359c27414dc6f99a580aa154e4 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Sat, 6 Apr 2024 18:19:06 +0000 Subject: [PATCH] Release v0.2.27 --- pyproject.toml | 2 +- src/superagent/core/client_wrapper.py | 2 +- src/superagent/resources/workflow/client.py | 10 ++++++++++ src/superagent/types/tool_type.py | 4 ++++ 4 files changed, 16 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 8523743..2a37a28 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "superagent-py" -version = "v0.2.26" +version = "v0.2.27" description = "" readme = "README.md" authors = [] diff --git a/src/superagent/core/client_wrapper.py b/src/superagent/core/client_wrapper.py index 2c2a71b..b9141e9 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.26", + "X-Fern-SDK-Version": "v0.2.27", } token = self._get_token() if token is not None: diff --git a/src/superagent/resources/workflow/client.py b/src/superagent/resources/workflow/client.py index 97ca194..fdfc5c9 100644 --- a/src/superagent/resources/workflow/client.py +++ b/src/superagent/resources/workflow/client.py @@ -286,6 +286,7 @@ def invoke( enable_streaming: bool, session_id: typing.Optional[str] = OMIT, output_schemas: typing.Optional[typing.Dict[str, str]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -302,6 +303,8 @@ def invoke( - output_schemas: typing.Optional[typing.Dict[str, str]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} @@ -309,6 +312,8 @@ def invoke( _request["sessionId"] = session_id if output_schemas is not OMIT: _request["outputSchemas"] = output_schemas + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin( @@ -751,6 +756,7 @@ async def invoke( enable_streaming: bool, session_id: typing.Optional[str] = OMIT, output_schemas: typing.Optional[typing.Dict[str, str]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -767,6 +773,8 @@ async def invoke( - output_schemas: typing.Optional[typing.Dict[str, str]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} @@ -774,6 +782,8 @@ async def invoke( _request["sessionId"] = session_id if output_schemas is not OMIT: _request["outputSchemas"] = output_schemas + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin( diff --git a/src/superagent/types/tool_type.py b/src/superagent/types/tool_type.py index 99ba8b7..e9d1ece 100644 --- a/src/superagent/types/tool_type.py +++ b/src/superagent/types/tool_type.py @@ -33,6 +33,7 @@ class ToolType(str, enum.Enum): RESEARCH = "RESEARCH" GITHUB = "GITHUB" SCRAPER = "SCRAPER" + ADVANCED_SCRAPER = "ADVANCED_SCRAPER" GOOGLE_SEARCH = "GOOGLE_SEARCH" def visit( @@ -59,6 +60,7 @@ def visit( research: typing.Callable[[], T_Result], github: typing.Callable[[], T_Result], scraper: typing.Callable[[], T_Result], + advanced_scraper: typing.Callable[[], T_Result], google_search: typing.Callable[[], T_Result], ) -> T_Result: if self is ToolType.ALGOLIA: @@ -105,5 +107,7 @@ def visit( return github() if self is ToolType.SCRAPER: return scraper() + if self is ToolType.ADVANCED_SCRAPER: + return advanced_scraper() if self is ToolType.GOOGLE_SEARCH: return google_search()