Skip to content

Commit

Permalink
Release 0.0.55
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Aug 21, 2023
1 parent 13d63d8 commit 90116f1
Show file tree
Hide file tree
Showing 45 changed files with 1,320 additions and 177 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.54"
version = "v0.0.55"
description = ""
readme = "README.md"
authors = []
Expand Down
68 changes: 67 additions & 1 deletion src/superagent/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,41 @@
# This file was auto-generated by Fern from our API Definition.

from .types import HttpValidationError, ValidationError, ValidationErrorLocItem
from .types import (
AgentDocumentListOuput,
AgentDocumentOutput,
AgentListOutput,
AgentOutput,
AgentToolListOutput,
AgentToolOutput,
AgentType,
ApiTokenListOutput,
ApiTokenOutput,
AppLibModelsResponseAgent,
AppLibModelsResponseAgentDocument,
AppLibModelsResponseAgentTool,
AppLibModelsResponseApiToken,
AppLibModelsResponseDocument,
AppLibModelsResponsePrompt,
AppLibModelsResponseTag,
AppLibModelsResponseTool,
DocumentListOutput,
DocumentOuput,
DocumentType,
HttpValidationError,
PredictAgentOutput,
PromptListOutput,
PromptOutput,
SignInOutput,
TagListOutput,
TagOutput,
ToolListOutput,
ToolOutput,
ToolType,
User,
UserOutput,
ValidationError,
ValidationErrorLocItem,
)
from .errors import UnprocessableEntityError
from .resources import (
agent,
Expand All @@ -17,8 +52,39 @@
)

__all__ = [
"AgentDocumentListOuput",
"AgentDocumentOutput",
"AgentListOutput",
"AgentOutput",
"AgentToolListOutput",
"AgentToolOutput",
"AgentType",
"ApiTokenListOutput",
"ApiTokenOutput",
"AppLibModelsResponseAgent",
"AppLibModelsResponseAgentDocument",
"AppLibModelsResponseAgentTool",
"AppLibModelsResponseApiToken",
"AppLibModelsResponseDocument",
"AppLibModelsResponsePrompt",
"AppLibModelsResponseTag",
"AppLibModelsResponseTool",
"DocumentListOutput",
"DocumentOuput",
"DocumentType",
"HttpValidationError",
"PredictAgentOutput",
"PromptListOutput",
"PromptOutput",
"SignInOutput",
"TagListOutput",
"TagOutput",
"ToolListOutput",
"ToolOutput",
"ToolType",
"UnprocessableEntityError",
"User",
"UserOutput",
"ValidationError",
"ValidationErrorLocItem",
"agent",
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.0.54",
"X-Fern-SDK-Version": "v0.0.55",
}
token = self._get_token()
if token is not None:
Expand Down
59 changes: 31 additions & 28 deletions src/superagent/resources/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
from ...core.jsonable_encoder import jsonable_encoder
from ...errors.unprocessable_entity_error import UnprocessableEntityError
from ...types.agent_list_output import AgentListOutput
from ...types.agent_output import AgentOutput
from ...types.http_validation_error import HttpValidationError
from ...types.predict_agent_output import PredictAgentOutput

# this is used as the default value for optional parameters
OMIT = typing.cast(typing.Any, ...)
Expand All @@ -20,7 +23,7 @@ class AgentClient:
def __init__(self, *, client_wrapper: SyncClientWrapper):
self._client_wrapper = client_wrapper

def list_all_agents(self) -> typing.Any:
def list_all_agents(self) -> AgentListOutput:
"""
List all agents
"""
Expand All @@ -31,7 +34,7 @@ def list_all_agents(self) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentListOutput, _response.json()) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand All @@ -48,7 +51,7 @@ def create_agent(
llm: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
has_memory: typing.Optional[bool] = OMIT,
prompt_id: typing.Optional[str] = OMIT,
) -> typing.Any:
) -> AgentOutput:
"""
Create a new agent
Expand Down Expand Up @@ -86,7 +89,7 @@ def create_agent(
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -95,7 +98,7 @@ def create_agent(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def list_library_agents(self) -> typing.Any:
def list_library_agents(self) -> AgentListOutput:
"""
List all library agents
"""
Expand All @@ -106,14 +109,14 @@ def list_library_agents(self) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentListOutput, _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 get_agent(self, agent_id: str) -> typing.Any:
def get_agent(self, agent_id: str) -> AgentOutput:
"""
Get a specific agent
Expand All @@ -127,7 +130,7 @@ def get_agent(self, agent_id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -136,7 +139,7 @@ def get_agent(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -> typing.Any:
def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -> AgentOutput:
"""
Patch a specific agent
Expand All @@ -153,7 +156,7 @@ def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -162,7 +165,7 @@ def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def delete_agent(self, agent_id: str) -> typing.Any:
def delete_agent(self, agent_id: str) -> AgentOutput:
"""
Delete a specific agent
Expand All @@ -176,7 +179,7 @@ def delete_agent(self, agent_id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -192,7 +195,7 @@ def prompt_agent(
input: typing.Dict[str, typing.Any],
has_streaming: typing.Optional[bool] = OMIT,
session: typing.Optional[str] = OMIT,
) -> typing.Any:
) -> PredictAgentOutput:
"""
Invoke a specific agent
Expand All @@ -218,7 +221,7 @@ def prompt_agent(
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(PredictAgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -232,7 +235,7 @@ class AsyncAgentClient:
def __init__(self, *, client_wrapper: AsyncClientWrapper):
self._client_wrapper = client_wrapper

async def list_all_agents(self) -> typing.Any:
async def list_all_agents(self) -> AgentListOutput:
"""
List all agents
"""
Expand All @@ -243,7 +246,7 @@ async def list_all_agents(self) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentListOutput, _response.json()) # type: ignore
try:
_response_json = _response.json()
except JSONDecodeError:
Expand All @@ -260,7 +263,7 @@ async def create_agent(
llm: typing.Optional[typing.Dict[str, typing.Any]] = OMIT,
has_memory: typing.Optional[bool] = OMIT,
prompt_id: typing.Optional[str] = OMIT,
) -> typing.Any:
) -> AgentOutput:
"""
Create a new agent
Expand Down Expand Up @@ -298,7 +301,7 @@ async def create_agent(
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -307,7 +310,7 @@ async def create_agent(
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def list_library_agents(self) -> typing.Any:
async def list_library_agents(self) -> AgentListOutput:
"""
List all library agents
"""
Expand All @@ -318,14 +321,14 @@ async def list_library_agents(self) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentListOutput, _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 get_agent(self, agent_id: str) -> typing.Any:
async def get_agent(self, agent_id: str) -> AgentOutput:
"""
Get a specific agent
Expand All @@ -339,7 +342,7 @@ async def get_agent(self, agent_id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -348,7 +351,7 @@ async def get_agent(self, agent_id: str) -> typing.Any:
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -> typing.Any:
async def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.Any]) -> AgentOutput:
"""
Patch a specific agent
Expand All @@ -365,7 +368,7 @@ async def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.A
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -374,7 +377,7 @@ async def patch_agent(self, agent_id: str, *, request: typing.Dict[str, typing.A
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def delete_agent(self, agent_id: str) -> typing.Any:
async def delete_agent(self, agent_id: str) -> AgentOutput:
"""
Delete a specific agent
Expand All @@ -388,7 +391,7 @@ async def delete_agent(self, agent_id: str) -> typing.Any:
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(AgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand All @@ -404,7 +407,7 @@ async def prompt_agent(
input: typing.Dict[str, typing.Any],
has_streaming: typing.Optional[bool] = OMIT,
session: typing.Optional[str] = OMIT,
) -> typing.Any:
) -> PredictAgentOutput:
"""
Invoke a specific agent
Expand All @@ -430,7 +433,7 @@ async def prompt_agent(
timeout=60,
)
if 200 <= _response.status_code < 300:
return pydantic.parse_obj_as(typing.Any, _response.json()) # type: ignore
return pydantic.parse_obj_as(PredictAgentOutput, _response.json()) # type: ignore
if _response.status_code == 422:
raise UnprocessableEntityError(pydantic.parse_obj_as(HttpValidationError, _response.json())) # type: ignore
try:
Expand Down
Loading

0 comments on commit 90116f1

Please sign in to comment.