Skip to content

Commit

Permalink
Release 0.0.40
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 1, 2023
1 parent 5396d48 commit c67f8e7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 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.0.39"
version = "v0.0.40"
description = ""
readme = "README.md"
authors = []
Expand Down
18 changes: 16 additions & 2 deletions src/superagent/resources/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,18 @@ def delete_agent(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response_json)

def prompt_agent(
self, agent_id: str, *, input: typing.Dict[str, typing.Any], has_streaming: typing.Optional[bool] = OMIT
self,
agent_id: str,
*,
input: typing.Dict[str, typing.Any],
has_streaming: typing.Optional[bool] = OMIT,
session: typing.Optional[str] = OMIT,
) -> typing.Any:
_request: typing.Dict[str, typing.Any] = {"input": input}
if has_streaming is not OMIT:
_request["has_streaming"] = has_streaming
if session is not OMIT:
_request["session"] = session
_response = httpx.request(
"POST",
urllib.parse.urljoin(f"{self._environment}/", f"api/v1/agents/{agent_id}/predict"),
Expand Down Expand Up @@ -279,11 +286,18 @@ async def delete_agent(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response_json)

async def prompt_agent(
self, agent_id: str, *, input: typing.Dict[str, typing.Any], has_streaming: typing.Optional[bool] = OMIT
self,
agent_id: str,
*,
input: typing.Dict[str, typing.Any],
has_streaming: typing.Optional[bool] = OMIT,
session: typing.Optional[str] = OMIT,
) -> typing.Any:
_request: typing.Dict[str, typing.Any] = {"input": input}
if has_streaming is not OMIT:
_request["has_streaming"] = has_streaming
if session is not OMIT:
_request["session"] = session
async with httpx.AsyncClient() as _client:
_response = await _client.request(
"POST",
Expand Down

0 comments on commit c67f8e7

Please sign in to comment.