diff --git a/.gitignore b/.gitignore index 87797408..95ceb189 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ .prism.log -.vscode _dev __pycache__ diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 5547f83e..10f30916 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.1" + ".": "0.2.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 8701346d..fd51d354 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 34 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-62a09183a027c64707ad1b9d7a5ccc66c8abf3965e6075282cb5ab72f742a2b3.yml -openapi_spec_hash: 47f43703822077a82e2edf82d4b7e0e5 -config_hash: 8d5db979856e35045ae2cdc248ddae47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/sgp%2Fagentex-sdk-782d59cf134b51ddd5058ae6e1630057093a6034b1d90663ab67836802b67cc6.yml +openapi_spec_hash: 3356926852d5d095d572b4fdce242836 +config_hash: 7c1f6794a184ee175dd94f2f7c2b496b diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..5b010307 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.analysis.importFormat": "relative", +} diff --git a/CHANGELOG.md b/CHANGELOG.md index ad6849f2..7ba7deba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## 0.2.0 (2025-07-25) + +Full Changelog: [v0.1.1...v0.2.0](https://github.com/scaleapi/agentex-python/compare/v0.1.1...v0.2.0) + +### Features + +* **api:** update typescript sdk with big changes ([2c75d64](https://github.com/scaleapi/agentex-python/commit/2c75d642348df727505778c347efa568930ea4f0)) + + +### Chores + +* **project:** add settings file for vscode ([0f926cc](https://github.com/scaleapi/agentex-python/commit/0f926cce7df375de33627f8212caacf64f89b1ed)) + ## 0.1.1 (2025-07-24) Full Changelog: [v0.1.0...v0.1.1](https://github.com/scaleapi/agentex-python/compare/v0.1.0...v0.1.1) diff --git a/api.md b/api.md index 0167ad25..3c69ec52 100644 --- a/api.md +++ b/api.md @@ -6,7 +6,6 @@ Types: from agentex.types import ( AcpType, Agent, - AgentRpcParams, AgentRpcRequest, AgentRpcResponse, AgentRpcResult, diff --git a/pyproject.toml b/pyproject.toml index 6919f8a4..24778438 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "agentex-sdk" -version = "0.1.1" +version = "0.2.0" description = "The official Python library for the agentex API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/agentex/_version.py b/src/agentex/_version.py index 9842f69a..aba87a2e 100644 --- a/src/agentex/_version.py +++ b/src/agentex/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "agentex" -__version__ = "0.1.1" # x-release-please-version +__version__ = "0.2.0" # x-release-please-version diff --git a/src/agentex/resources/agents.py b/src/agentex/resources/agents.py index 8b329be8..dccba983 100644 --- a/src/agentex/resources/agents.py +++ b/src/agentex/resources/agents.py @@ -7,7 +7,7 @@ import httpx -from ..types import AgentRpcParams, agent_rpc_params, agent_list_params, agent_rpc_by_name_params +from ..types import agent_rpc_params, agent_list_params, agent_rpc_by_name_params from .._types import NOT_GIVEN, Body, Query, Headers, NotGiven from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property @@ -20,7 +20,6 @@ ) from ..types.agent import Agent from .._base_client import make_request_options -from ..types.agent_rpc_params import AgentRpcParams from ..types.agent_rpc_response import AgentRpcResponse from ..types.agent_list_response import AgentListResponse @@ -221,7 +220,7 @@ def rpc( agent_id: str, *, method: Literal["event/send", "task/create", "message/send", "task/cancel"], - params: AgentRpcParams, + params: agent_rpc_params.Params, id: Union[int, str, None] | NotGiven = NOT_GIVEN, jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -269,7 +268,7 @@ def rpc_by_name( agent_name: str, *, method: Literal["event/send", "task/create", "message/send", "task/cancel"], - params: AgentRpcParams, + params: agent_rpc_by_name_params.Params, id: Union[int, str, None] | NotGiven = NOT_GIVEN, jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -507,7 +506,7 @@ async def rpc( agent_id: str, *, method: Literal["event/send", "task/create", "message/send", "task/cancel"], - params: AgentRpcParams, + params: agent_rpc_params.Params, id: Union[int, str, None] | NotGiven = NOT_GIVEN, jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -555,7 +554,7 @@ async def rpc_by_name( agent_name: str, *, method: Literal["event/send", "task/create", "message/send", "task/cancel"], - params: AgentRpcParams, + params: agent_rpc_by_name_params.Params, id: Union[int, str, None] | NotGiven = NOT_GIVEN, jsonrpc: Literal["2.0"] | NotGiven = NOT_GIVEN, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. diff --git a/src/agentex/types/agent_rpc_by_name_params.py b/src/agentex/types/agent_rpc_by_name_params.py index 5be189d7..b84da84c 100644 --- a/src/agentex/types/agent_rpc_by_name_params.py +++ b/src/agentex/types/agent_rpc_by_name_params.py @@ -2,20 +2,70 @@ from __future__ import annotations -from typing import Union -from typing_extensions import Literal, Required, TypedDict +from typing import Dict, Union, Optional +from typing_extensions import Literal, Required, TypeAlias, TypedDict -from .agent_rpc_params import AgentRpcParams +from .task_message_content_param import TaskMessageContentParam -__all__ = ["AgentRpcByNameParams"] +__all__ = [ + "AgentRpcByNameParams", + "Params", + "ParamsCreateTaskRequest", + "ParamsCancelTaskRequest", + "ParamsSendMessageRequest", + "ParamsSendEventRequest", +] class AgentRpcByNameParams(TypedDict, total=False): method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]] - params: Required[AgentRpcParams] + params: Required[Params] """The parameters for the agent RPC request""" id: Union[int, str, None] jsonrpc: Literal["2.0"] + + +class ParamsCreateTaskRequest(TypedDict, total=False): + name: Optional[str] + """The name of the task to create""" + + params: Optional[Dict[str, object]] + """The parameters for the task""" + + +class ParamsCancelTaskRequest(TypedDict, total=False): + task_id: Optional[str] + """The ID of the task to cancel. Either this or task_name must be provided.""" + + task_name: Optional[str] + """The name of the task to cancel. Either this or task_id must be provided.""" + + +class ParamsSendMessageRequest(TypedDict, total=False): + content: Required[TaskMessageContentParam] + """The message that was sent to the agent""" + + stream: bool + """Whether to stream the response message back to the client""" + + task_id: Optional[str] + """The ID of the task that the message was sent to""" + + +class ParamsSendEventRequest(TypedDict, total=False): + content: Optional[TaskMessageContentParam] + """The content to send to the event""" + + task_id: Optional[str] + """The ID of the task that the event was sent to""" + + task_name: Optional[str] + """The name of the task that the event was sent to""" + + +Params: TypeAlias = Union[ + ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest +] diff --git a/src/agentex/types/agent_rpc_params.py b/src/agentex/types/agent_rpc_params.py index 5082b18c..e4ae3ab1 100644 --- a/src/agentex/types/agent_rpc_params.py +++ b/src/agentex/types/agent_rpc_params.py @@ -3,14 +3,32 @@ from __future__ import annotations from typing import Dict, Union, Optional -from typing_extensions import Required, TypeAlias, TypedDict +from typing_extensions import Literal, Required, TypeAlias, TypedDict from .task_message_content_param import TaskMessageContentParam -__all__ = ["AgentRpcParams", "CreateTaskRequest", "CancelTaskRequest", "SendMessageRequest", "SendEventRequest"] +__all__ = [ + "AgentRpcParams", + "Params", + "ParamsCreateTaskRequest", + "ParamsCancelTaskRequest", + "ParamsSendMessageRequest", + "ParamsSendEventRequest", +] -class CreateTaskRequest(TypedDict, total=False): +class AgentRpcParams(TypedDict, total=False): + method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]] + + params: Required[Params] + """The parameters for the agent RPC request""" + + id: Union[int, str, None] + + jsonrpc: Literal["2.0"] + + +class ParamsCreateTaskRequest(TypedDict, total=False): name: Optional[str] """The name of the task to create""" @@ -18,7 +36,7 @@ class CreateTaskRequest(TypedDict, total=False): """The parameters for the task""" -class CancelTaskRequest(TypedDict, total=False): +class ParamsCancelTaskRequest(TypedDict, total=False): task_id: Optional[str] """The ID of the task to cancel. Either this or task_name must be provided.""" @@ -26,7 +44,7 @@ class CancelTaskRequest(TypedDict, total=False): """The name of the task to cancel. Either this or task_id must be provided.""" -class SendMessageRequest(TypedDict, total=False): +class ParamsSendMessageRequest(TypedDict, total=False): content: Required[TaskMessageContentParam] """The message that was sent to the agent""" @@ -37,7 +55,7 @@ class SendMessageRequest(TypedDict, total=False): """The ID of the task that the message was sent to""" -class SendEventRequest(TypedDict, total=False): +class ParamsSendEventRequest(TypedDict, total=False): content: Optional[TaskMessageContentParam] """The content to send to the event""" @@ -48,4 +66,6 @@ class SendEventRequest(TypedDict, total=False): """The name of the task that the event was sent to""" -AgentRpcParams: TypeAlias = Union[CreateTaskRequest, CancelTaskRequest, SendMessageRequest, SendEventRequest] +Params: TypeAlias = Union[ + ParamsCreateTaskRequest, ParamsCancelTaskRequest, ParamsSendMessageRequest, ParamsSendEventRequest +] diff --git a/src/agentex/types/agent_rpc_params1.py b/src/agentex/types/agent_rpc_params1.py deleted file mode 100644 index 3eae8b68..00000000 --- a/src/agentex/types/agent_rpc_params1.py +++ /dev/null @@ -1,21 +0,0 @@ -# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. - -from __future__ import annotations - -from typing import Union -from typing_extensions import Literal, Required, TypedDict - -from . import agent_rpc_params - -__all__ = ["AgentRpcParams"] - - -class AgentRpcParams(TypedDict, total=False): - method: Required[Literal["event/send", "task/create", "message/send", "task/cancel"]] - - params: Required[agent_rpc_params.AgentRpcParams] - """The parameters for the agent RPC request""" - - id: Union[int, str, None] - - jsonrpc: Literal["2.0"]