diff --git a/pyproject.toml b/pyproject.toml index f871c7e..4562c14 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "superagent-py" -version = "v0.2.24" +version = "v0.2.25" description = "" readme = "README.md" authors = [] diff --git a/src/superagent/core/client_wrapper.py b/src/superagent/core/client_wrapper.py index ddd155e..f17cee6 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.24", + "X-Fern-SDK-Version": "v0.2.25", } token = self._get_token() if token is not None: diff --git a/src/superagent/resources/agent/client.py b/src/superagent/resources/agent/client.py index 77970e1..1cc2100 100644 --- a/src/superagent/resources/agent/client.py +++ b/src/superagent/resources/agent/client.py @@ -105,6 +105,7 @@ def create( type: typing.Optional[AgentType] = OMIT, parameters: typing.Optional[OpenAiAssistantParameters] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ @@ -133,6 +134,8 @@ def create( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name} @@ -156,6 +159,8 @@ def create( _request["parameters"] = parameters if metadata is not OMIT: _request["metadata"] = metadata + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), @@ -287,6 +292,7 @@ def update( avatar: typing.Optional[str] = OMIT, type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ @@ -313,6 +319,8 @@ def update( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} @@ -334,6 +342,8 @@ def update( _request["type"] = type if metadata is not OMIT: _request["metadata"] = metadata + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( @@ -897,6 +907,7 @@ async def create( type: typing.Optional[AgentType] = OMIT, parameters: typing.Optional[OpenAiAssistantParameters] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ @@ -925,6 +936,8 @@ async def create( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"name": name} @@ -948,6 +961,8 @@ async def create( _request["parameters"] = parameters if metadata is not OMIT: _request["metadata"] = metadata + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"), @@ -1081,6 +1096,7 @@ async def update( avatar: typing.Optional[str] = OMIT, type: typing.Optional[str] = OMIT, metadata: typing.Optional[typing.Dict[str, typing.Any]] = OMIT, + output_schema: typing.Optional[str] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> AppModelsResponseAgent: """ @@ -1107,6 +1123,8 @@ async def update( - metadata: typing.Optional[typing.Dict[str, typing.Any]]. + - output_schema: typing.Optional[str]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {} @@ -1128,6 +1146,8 @@ async def update( _request["type"] = type if metadata is not OMIT: _request["metadata"] = metadata + if output_schema is not OMIT: + _request["outputSchema"] = output_schema _response = await self._client_wrapper.httpx_client.request( "PATCH", urllib.parse.urljoin( diff --git a/src/superagent/resources/workflow/client.py b/src/superagent/resources/workflow/client.py index 5c3d88e..97ca194 100644 --- a/src/superagent/resources/workflow/client.py +++ b/src/superagent/resources/workflow/client.py @@ -285,6 +285,7 @@ def invoke( input: str, enable_streaming: bool, session_id: typing.Optional[str] = OMIT, + output_schemas: typing.Optional[typing.Dict[str, str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -299,11 +300,15 @@ def invoke( - session_id: typing.Optional[str]. + - output_schemas: typing.Optional[typing.Dict[str, str]]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: _request["sessionId"] = session_id + if output_schemas is not OMIT: + _request["outputSchemas"] = output_schemas _response = self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin( @@ -745,6 +750,7 @@ async def invoke( input: str, enable_streaming: bool, session_id: typing.Optional[str] = OMIT, + output_schemas: typing.Optional[typing.Dict[str, str]] = OMIT, request_options: typing.Optional[RequestOptions] = None, ) -> typing.Any: """ @@ -759,11 +765,15 @@ async def invoke( - session_id: typing.Optional[str]. + - output_schemas: typing.Optional[typing.Dict[str, str]]. + - request_options: typing.Optional[RequestOptions]. Request-specific configuration. """ _request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming} if session_id is not OMIT: _request["sessionId"] = session_id + if output_schemas is not OMIT: + _request["outputSchemas"] = output_schemas _response = await self._client_wrapper.httpx_client.request( "POST", urllib.parse.urljoin( diff --git a/src/superagent/types/prisma_models_agent.py b/src/superagent/types/prisma_models_agent.py index f682b17..bd39c28 100644 --- a/src/superagent/types/prisma_models_agent.py +++ b/src/superagent/types/prisma_models_agent.py @@ -40,6 +40,7 @@ class PrismaModelsAgent(pydantic.BaseModel): alias="workflowSteps", default=None ) metadata: typing.Optional[typing.Any] = None + output_schema: typing.Optional[str] = pydantic.Field(alias="outputSchema", 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/tool_type.py b/src/superagent/types/tool_type.py index 96c7b42..99ba8b7 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" + GOOGLE_SEARCH = "GOOGLE_SEARCH" def visit( self, @@ -58,6 +59,7 @@ def visit( research: typing.Callable[[], T_Result], github: typing.Callable[[], T_Result], scraper: typing.Callable[[], T_Result], + google_search: typing.Callable[[], T_Result], ) -> T_Result: if self is ToolType.ALGOLIA: return algolia() @@ -103,3 +105,5 @@ def visit( return github() if self is ToolType.SCRAPER: return scraper() + if self is ToolType.GOOGLE_SEARCH: + return google_search()