Skip to content

Commit

Permalink
Release v0.2.11
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Feb 26, 2024
1 parent 4a1e578 commit 0a9e690
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 5 deletions.
6 changes: 3 additions & 3 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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.9"
version = "v0.2.11"
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.2.9",
"X-Fern-SDK-Version": "v0.2.11",
}
token = self._get_token()
if token is not None:
Expand Down
30 changes: 30 additions & 0 deletions src/superagent/resources/workflow_config/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ class WorkflowConfigClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper

def get_schema(self) -> typing.Any:
_response = self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows/config/schema"),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def add_config(self, workflow_id: str) -> typing.Any:
"""
Parameters:
Expand All @@ -45,6 +60,21 @@ class AsyncWorkflowConfigClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper

async def get_schema(self) -> typing.Any:
_response = await self._client_wrapper.httpx_client.request(
"GET",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/workflows/config/schema"),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def add_config(self, workflow_id: str) -> typing.Any:
"""
Parameters:
Expand Down

0 comments on commit 0a9e690

Please sign in to comment.