Skip to content

Commit

Permalink
Release v0.1.69
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jan 30, 2024
1 parent 53be2ce commit 182e1d0
Show file tree
Hide file tree
Showing 13 changed files with 288 additions and 34 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.1.68"
version = "v0.1.69"
description = ""
readme = "README.md"
authors = []
Expand Down
7 changes: 4 additions & 3 deletions src/superagent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
AgentList,
AgentRunList,
AgentToolList,
AppModelsRequestAgent,
AppModelsRequestDatasource,
AppModelsRequestLlm,
AppModelsRequestTool,
Expand Down Expand Up @@ -46,19 +45,19 @@
ValidationErrorLocItem,
VectorDbList,
VectorDbProvider,
WorkflowConfig,
WorkflowList,
WorkflowStepList,
)
from .errors import UnprocessableEntityError
from .resources import agent, api_user, datasource, llm, telemetry, tool, vector_database, workflow
from .resources import agent, api_user, datasource, llm, telemetry, tool, vector_database, workflow, workflow_config
from .environment import SuperagentEnvironment

__all__ = [
"AgentDatasosurceList",
"AgentList",
"AgentRunList",
"AgentToolList",
"AppModelsRequestAgent",
"AppModelsRequestDatasource",
"AppModelsRequestLlm",
"AppModelsRequestTool",
Expand Down Expand Up @@ -101,6 +100,7 @@
"ValidationErrorLocItem",
"VectorDbList",
"VectorDbProvider",
"WorkflowConfig",
"WorkflowList",
"WorkflowStepList",
"agent",
Expand All @@ -111,4 +111,5 @@
"tool",
"vector_database",
"workflow",
"workflow_config",
]
3 changes: 3 additions & 0 deletions src/superagent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from .resources.tool.client import AsyncToolClient, ToolClient
from .resources.vector_database.client import AsyncVectorDatabaseClient, VectorDatabaseClient
from .resources.workflow.client import AsyncWorkflowClient, WorkflowClient
from .resources.workflow_config.client import AsyncWorkflowConfigClient, WorkflowConfigClient


class Superagent:
Expand All @@ -37,6 +38,7 @@ def __init__(
self.datasource = DatasourceClient(client_wrapper=self._client_wrapper)
self.tool = ToolClient(client_wrapper=self._client_wrapper)
self.workflow = WorkflowClient(client_wrapper=self._client_wrapper)
self.workflow_config = WorkflowConfigClient(client_wrapper=self._client_wrapper)
self.vector_database = VectorDatabaseClient(client_wrapper=self._client_wrapper)
self.telemetry = TelemetryClient(client_wrapper=self._client_wrapper)

Expand All @@ -62,6 +64,7 @@ def __init__(
self.datasource = AsyncDatasourceClient(client_wrapper=self._client_wrapper)
self.tool = AsyncToolClient(client_wrapper=self._client_wrapper)
self.workflow = AsyncWorkflowClient(client_wrapper=self._client_wrapper)
self.workflow_config = AsyncWorkflowConfigClient(client_wrapper=self._client_wrapper)
self.vector_database = AsyncVectorDatabaseClient(client_wrapper=self._client_wrapper)
self.telemetry = AsyncTelemetryClient(client_wrapper=self._client_wrapper)

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.1.68",
"X-Fern-SDK-Version": "v0.1.69",
}
token = self._get_token()
if token is not None:
Expand Down
14 changes: 12 additions & 2 deletions src/superagent/resources/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# This file was auto-generated by Fern from our API Definition.

from . import agent, api_user, datasource, llm, telemetry, tool, vector_database, workflow
from . import agent, api_user, datasource, llm, telemetry, tool, vector_database, workflow, workflow_config

__all__ = ["agent", "api_user", "datasource", "llm", "telemetry", "tool", "vector_database", "workflow"]
__all__ = [
"agent",
"api_user",
"datasource",
"llm",
"telemetry",
"tool",
"vector_database",
"workflow",
"workflow_config",
]
182 changes: 169 additions & 13 deletions src/superagent/resources/agent/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
from ...types.agent_datasosurce_list import AgentDatasosurceList
from ...types.agent_list import AgentList
from ...types.agent_tool_list import AgentToolList
from ...types.app_models_request_agent import AppModelsRequestAgent
from ...types.app_models_response_agent import AppModelsResponseAgent
from ...types.app_models_response_agent_invoke import AppModelsResponseAgentInvoke
from ...types.http_validation_error import HttpValidationError
from ...types.llm_params import LlmParams
from ...types.llm_provider import LlmProvider

try:
import pydantic.v1 as pydantic # type: ignore
Expand Down Expand Up @@ -57,17 +57,57 @@ def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional[int]
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

def create(self, *, request: AppModelsRequestAgent) -> AppModelsResponseAgent:
def create(
self,
*,
is_active: typing.Optional[bool] = OMIT,
name: str,
initial_message: typing.Optional[str] = OMIT,
prompt: typing.Optional[str] = OMIT,
llm_model: typing.Optional[str] = OMIT,
llm_provider: typing.Optional[LlmProvider] = OMIT,
description: typing.Optional[str] = OMIT,
avatar: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgent:
"""
Create a new agent
Parameters:
- request: AppModelsRequestAgent.
- is_active: typing.Optional[bool].
- name: str.
- initial_message: typing.Optional[str].
- prompt: typing.Optional[str].
- llm_model: typing.Optional[str].
- llm_provider: typing.Optional[LlmProvider].
- description: typing.Optional[str].
- avatar: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {"name": name}
if is_active is not OMIT:
_request["isActive"] = is_active
if initial_message is not OMIT:
_request["initialMessage"] = initial_message
if prompt is not OMIT:
_request["prompt"] = prompt
if llm_model is not OMIT:
_request["llmModel"] = llm_model
if llm_provider is not OMIT:
_request["llmProvider"] = llm_provider.value
if description is not OMIT:
_request["description"] = description
if avatar is not OMIT:
_request["avatar"] = avatar
_response = self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"),
json=jsonable_encoder(request),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -127,19 +167,57 @@ def delete(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 update(self, agent_id: str, *, request: AppModelsRequestAgent) -> AppModelsResponseAgent:
def update(
self,
agent_id: str,
*,
is_active: typing.Optional[bool] = OMIT,
name: typing.Optional[str] = OMIT,
initial_message: typing.Optional[str] = OMIT,
prompt: typing.Optional[str] = OMIT,
llm_model: typing.Optional[str] = OMIT,
description: typing.Optional[str] = OMIT,
avatar: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgent:
"""
Patch an agent
Parameters:
- agent_id: str.
- request: AppModelsRequestAgent.
- is_active: typing.Optional[bool].
- name: typing.Optional[str].
- initial_message: typing.Optional[str].
- prompt: typing.Optional[str].
- llm_model: typing.Optional[str].
- description: typing.Optional[str].
- avatar: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {}
if is_active is not OMIT:
_request["isActive"] = is_active
if name is not OMIT:
_request["name"] = name
if initial_message is not OMIT:
_request["initialMessage"] = initial_message
if prompt is not OMIT:
_request["prompt"] = prompt
if llm_model is not OMIT:
_request["llmModel"] = llm_model
if description is not OMIT:
_request["description"] = description
if avatar is not OMIT:
_request["avatar"] = avatar
_response = self._client_wrapper.httpx_client.request(
"PATCH",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"),
json=jsonable_encoder(request),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -437,17 +515,57 @@ async def list(self, *, skip: typing.Optional[int] = None, take: typing.Optional
raise ApiError(status_code=_response.status_code, body=_response.text)
raise ApiError(status_code=_response.status_code, body=_response_json)

async def create(self, *, request: AppModelsRequestAgent) -> AppModelsResponseAgent:
async def create(
self,
*,
is_active: typing.Optional[bool] = OMIT,
name: str,
initial_message: typing.Optional[str] = OMIT,
prompt: typing.Optional[str] = OMIT,
llm_model: typing.Optional[str] = OMIT,
llm_provider: typing.Optional[LlmProvider] = OMIT,
description: typing.Optional[str] = OMIT,
avatar: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgent:
"""
Create a new agent
Parameters:
- request: AppModelsRequestAgent.
- is_active: typing.Optional[bool].
- name: str.
- initial_message: typing.Optional[str].
- prompt: typing.Optional[str].
- llm_model: typing.Optional[str].
- llm_provider: typing.Optional[LlmProvider].
- description: typing.Optional[str].
- avatar: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {"name": name}
if is_active is not OMIT:
_request["isActive"] = is_active
if initial_message is not OMIT:
_request["initialMessage"] = initial_message
if prompt is not OMIT:
_request["prompt"] = prompt
if llm_model is not OMIT:
_request["llmModel"] = llm_model
if llm_provider is not OMIT:
_request["llmProvider"] = llm_provider.value
if description is not OMIT:
_request["description"] = description
if avatar is not OMIT:
_request["avatar"] = avatar
_response = await self._client_wrapper.httpx_client.request(
"POST",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", "api/v1/agents"),
json=jsonable_encoder(request),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down Expand Up @@ -507,19 +625,57 @@ async def delete(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 update(self, agent_id: str, *, request: AppModelsRequestAgent) -> AppModelsResponseAgent:
async def update(
self,
agent_id: str,
*,
is_active: typing.Optional[bool] = OMIT,
name: typing.Optional[str] = OMIT,
initial_message: typing.Optional[str] = OMIT,
prompt: typing.Optional[str] = OMIT,
llm_model: typing.Optional[str] = OMIT,
description: typing.Optional[str] = OMIT,
avatar: typing.Optional[str] = OMIT,
) -> AppModelsResponseAgent:
"""
Patch an agent
Parameters:
- agent_id: str.
- request: AppModelsRequestAgent.
- is_active: typing.Optional[bool].
- name: typing.Optional[str].
- initial_message: typing.Optional[str].
- prompt: typing.Optional[str].
- llm_model: typing.Optional[str].
- description: typing.Optional[str].
- avatar: typing.Optional[str].
"""
_request: typing.Dict[str, typing.Any] = {}
if is_active is not OMIT:
_request["isActive"] = is_active
if name is not OMIT:
_request["name"] = name
if initial_message is not OMIT:
_request["initialMessage"] = initial_message
if prompt is not OMIT:
_request["prompt"] = prompt
if llm_model is not OMIT:
_request["llmModel"] = llm_model
if description is not OMIT:
_request["description"] = description
if avatar is not OMIT:
_request["avatar"] = avatar
_response = await self._client_wrapper.httpx_client.request(
"PATCH",
urllib.parse.urljoin(f"{self._client_wrapper.get_base_url()}/", f"api/v1/agents/{agent_id}"),
json=jsonable_encoder(request),
json=jsonable_encoder(_request),
headers=self._client_wrapper.get_headers(),
timeout=60,
)
Expand Down
2 changes: 2 additions & 0 deletions src/superagent/resources/workflow_config/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was auto-generated by Fern from our API Definition.

Loading

0 comments on commit 182e1d0

Please sign in to comment.