Skip to content

Commit

Permalink
Release 0.1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Oct 15, 2023
1 parent ddf7a8f commit 68ebb7b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "superagent-py"
version = "v0.1.16"
version = "v0.1.17"
description = ""
readme = "README.md"
authors = []
Expand Down
2 changes: 1 addition & 1 deletion src/superagent/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,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.1.16",
"X-Fern-SDK-Version": "v0.1.17",
}
token = self._get_token()
if token is not None:
Expand Down
24 changes: 22 additions & 2 deletions src/superagent/resources/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,13 @@ def delete(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response_json)

def invoke(
self, agent_id: str, *, input: str, session_id: typing.Optional[str] = OMIT, enable_streaming: bool
self,
agent_id: str,
*,
input: str,
session_id: typing.Optional[str] = OMIT,
enable_streaming: bool,
output_schema: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgentInvoke:
"""
Invoke an agent
Expand All @@ -155,10 +161,14 @@ def invoke(
- session_id: typing.Optional[str].
- enable_streaming: bool.
- output_schema: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming}
if session_id is not OMIT:
_request["sessionId"] = session_id
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()}/", f"api/v1/agents/{agent_id}/invoke"),
Expand Down Expand Up @@ -522,7 +532,13 @@ async def delete(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response_json)

async def invoke(
self, agent_id: str, *, input: str, session_id: typing.Optional[str] = OMIT, enable_streaming: bool
self,
agent_id: str,
*,
input: str,
session_id: typing.Optional[str] = OMIT,
enable_streaming: bool,
output_schema: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgentInvoke:
"""
Invoke an agent
Expand All @@ -535,10 +551,14 @@ async def invoke(
- session_id: typing.Optional[str].
- enable_streaming: bool.
- output_schema: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {"input": input, "enableStreaming": enable_streaming}
if session_id is not OMIT:
_request["sessionId"] = session_id
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()}/", f"api/v1/agents/{agent_id}/invoke"),
Expand Down

0 comments on commit 68ebb7b

Please sign in to comment.