Skip to content

Commit

Permalink
Release v0.2.27
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Apr 6, 2024
1 parent a8c4bad commit 8cfc181
Show file tree
Hide file tree
Showing 4 changed files with 16 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.26"
version = "v0.2.27"
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.26",
"X-Fern-SDK-Version": "v0.2.27",
}
token = self._get_token()
if token is not None:
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 @@ -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:
"""
Expand All @@ -302,13 +303,17 @@ 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}
if session_id is not OMIT:
_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(
Expand Down Expand Up @@ -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:
"""
Expand All @@ -767,13 +773,17 @@ 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}
if session_id is not OMIT:
_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(
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"
ADVANCED_SCRAPER = "ADVANCED_SCRAPER"
GOOGLE_SEARCH = "GOOGLE_SEARCH"

def visit(
Expand All @@ -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:
Expand Down Expand Up @@ -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()

0 comments on commit 8cfc181

Please sign in to comment.