Skip to content

Commit

Permalink
Release v0.2.25
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 4, 2024
1 parent ff73640 commit 7416600
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 2 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.2.24"
version = "v0.2.25"
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 @@ -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:
Expand Down
20 changes: 20 additions & 0 deletions src/superagent/resources/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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}
Expand All @@ -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"),
Expand Down Expand Up @@ -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:
"""
Expand All @@ -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] = {}
Expand All @@ -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(
Expand Down Expand Up @@ -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:
"""
Expand Down Expand Up @@ -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}
Expand All @@ -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"),
Expand Down Expand Up @@ -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:
"""
Expand All @@ -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] = {}
Expand All @@ -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(
Expand Down
10 changes: 10 additions & 0 deletions src/superagent/resources/workflow/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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(
Expand Down Expand Up @@ -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:
"""
Expand All @@ -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(
Expand Down
1 change: 1 addition & 0 deletions src/superagent/types/prisma_models_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
4 changes: 4 additions & 0 deletions src/superagent/types/tool_type.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ToolType(str, enum.Enum):
RESEARCH = "RESEARCH"
GITHUB = "GITHUB"
SCRAPER = "SCRAPER"
GOOGLE_SEARCH = "GOOGLE_SEARCH"

def visit(
self,
Expand All @@ -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()
Expand Down Expand Up @@ -103,3 +105,5 @@ def visit(
return github()
if self is ToolType.SCRAPER:
return scraper()
if self is ToolType.GOOGLE_SEARCH:
return google_search()

0 comments on commit 7416600

Please sign in to comment.