agentex-sdk 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentex/__init__.py +103 -0
- agentex/_base_client.py +1992 -0
- agentex/_client.py +506 -0
- agentex/_compat.py +219 -0
- agentex/_constants.py +14 -0
- agentex/_exceptions.py +108 -0
- agentex/_files.py +123 -0
- agentex/_models.py +829 -0
- agentex/_qs.py +150 -0
- agentex/_resource.py +43 -0
- agentex/_response.py +830 -0
- agentex/_streaming.py +333 -0
- agentex/_types.py +219 -0
- agentex/_utils/__init__.py +57 -0
- agentex/_utils/_logs.py +25 -0
- agentex/_utils/_proxy.py +65 -0
- agentex/_utils/_reflection.py +42 -0
- agentex/_utils/_resources_proxy.py +24 -0
- agentex/_utils/_streams.py +12 -0
- agentex/_utils/_sync.py +86 -0
- agentex/_utils/_transform.py +447 -0
- agentex/_utils/_typing.py +151 -0
- agentex/_utils/_utils.py +422 -0
- agentex/_version.py +4 -0
- agentex/lib/.keep +4 -0
- agentex/lib/__init__.py +0 -0
- agentex/lib/adk/__init__.py +41 -0
- agentex/lib/adk/_modules/__init__.py +0 -0
- agentex/lib/adk/_modules/acp.py +247 -0
- agentex/lib/adk/_modules/agent_task_tracker.py +176 -0
- agentex/lib/adk/_modules/agents.py +77 -0
- agentex/lib/adk/_modules/events.py +141 -0
- agentex/lib/adk/_modules/messages.py +285 -0
- agentex/lib/adk/_modules/state.py +291 -0
- agentex/lib/adk/_modules/streaming.py +75 -0
- agentex/lib/adk/_modules/tasks.py +124 -0
- agentex/lib/adk/_modules/tracing.py +194 -0
- agentex/lib/adk/providers/__init__.py +9 -0
- agentex/lib/adk/providers/_modules/__init__.py +0 -0
- agentex/lib/adk/providers/_modules/litellm.py +232 -0
- agentex/lib/adk/providers/_modules/openai.py +416 -0
- agentex/lib/adk/providers/_modules/sgp.py +85 -0
- agentex/lib/adk/utils/__init__.py +5 -0
- agentex/lib/adk/utils/_modules/__init__.py +0 -0
- agentex/lib/adk/utils/_modules/templating.py +94 -0
- agentex/lib/cli/__init__.py +0 -0
- agentex/lib/cli/commands/__init__.py +0 -0
- agentex/lib/cli/commands/agents.py +328 -0
- agentex/lib/cli/commands/init.py +227 -0
- agentex/lib/cli/commands/main.py +33 -0
- agentex/lib/cli/commands/secrets.py +169 -0
- agentex/lib/cli/commands/tasks.py +118 -0
- agentex/lib/cli/commands/uv.py +133 -0
- agentex/lib/cli/handlers/__init__.py +0 -0
- agentex/lib/cli/handlers/agent_handlers.py +160 -0
- agentex/lib/cli/handlers/cleanup_handlers.py +186 -0
- agentex/lib/cli/handlers/deploy_handlers.py +351 -0
- agentex/lib/cli/handlers/run_handlers.py +452 -0
- agentex/lib/cli/handlers/secret_handlers.py +670 -0
- agentex/lib/cli/templates/default/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/default/Dockerfile-uv.j2 +42 -0
- agentex/lib/cli/templates/default/Dockerfile.j2 +42 -0
- agentex/lib/cli/templates/default/README.md.j2 +193 -0
- agentex/lib/cli/templates/default/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/default/manifest.yaml.j2 +116 -0
- agentex/lib/cli/templates/default/project/acp.py.j2 +29 -0
- agentex/lib/cli/templates/default/pyproject.toml.j2 +33 -0
- agentex/lib/cli/templates/default/requirements.txt.j2 +5 -0
- agentex/lib/cli/templates/deploy/Screenshot 2025-03-19 at 10.36.57/342/200/257AM.png +0 -0
- agentex/lib/cli/templates/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/sync/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/sync/Dockerfile-uv.j2 +42 -0
- agentex/lib/cli/templates/sync/Dockerfile.j2 +42 -0
- agentex/lib/cli/templates/sync/README.md.j2 +293 -0
- agentex/lib/cli/templates/sync/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/sync/manifest.yaml.j2 +116 -0
- agentex/lib/cli/templates/sync/project/acp.py.j2 +26 -0
- agentex/lib/cli/templates/sync/pyproject.toml.j2 +33 -0
- agentex/lib/cli/templates/sync/requirements.txt.j2 +5 -0
- agentex/lib/cli/templates/temporal/.dockerignore.j2 +43 -0
- agentex/lib/cli/templates/temporal/Dockerfile-uv.j2 +48 -0
- agentex/lib/cli/templates/temporal/Dockerfile.j2 +48 -0
- agentex/lib/cli/templates/temporal/README.md.j2 +316 -0
- agentex/lib/cli/templates/temporal/deploy/example.yaml.j2 +55 -0
- agentex/lib/cli/templates/temporal/manifest.yaml.j2 +137 -0
- agentex/lib/cli/templates/temporal/project/acp.py.j2 +30 -0
- agentex/lib/cli/templates/temporal/project/run_worker.py.j2 +33 -0
- agentex/lib/cli/templates/temporal/project/workflow.py.j2 +66 -0
- agentex/lib/cli/templates/temporal/pyproject.toml.j2 +34 -0
- agentex/lib/cli/templates/temporal/requirements.txt.j2 +5 -0
- agentex/lib/cli/utils/cli_utils.py +14 -0
- agentex/lib/cli/utils/credential_utils.py +103 -0
- agentex/lib/cli/utils/exceptions.py +6 -0
- agentex/lib/cli/utils/kubectl_utils.py +135 -0
- agentex/lib/cli/utils/kubernetes_secrets_utils.py +185 -0
- agentex/lib/core/__init__.py +0 -0
- agentex/lib/core/adapters/__init__.py +0 -0
- agentex/lib/core/adapters/llm/__init__.py +1 -0
- agentex/lib/core/adapters/llm/adapter_litellm.py +46 -0
- agentex/lib/core/adapters/llm/adapter_sgp.py +55 -0
- agentex/lib/core/adapters/llm/port.py +24 -0
- agentex/lib/core/adapters/streams/adapter_redis.py +128 -0
- agentex/lib/core/adapters/streams/port.py +50 -0
- agentex/lib/core/clients/__init__.py +1 -0
- agentex/lib/core/clients/temporal/__init__.py +0 -0
- agentex/lib/core/clients/temporal/temporal_client.py +181 -0
- agentex/lib/core/clients/temporal/types.py +47 -0
- agentex/lib/core/clients/temporal/utils.py +56 -0
- agentex/lib/core/services/__init__.py +0 -0
- agentex/lib/core/services/adk/__init__.py +0 -0
- agentex/lib/core/services/adk/acp/__init__.py +0 -0
- agentex/lib/core/services/adk/acp/acp.py +210 -0
- agentex/lib/core/services/adk/agent_task_tracker.py +85 -0
- agentex/lib/core/services/adk/agents.py +43 -0
- agentex/lib/core/services/adk/events.py +61 -0
- agentex/lib/core/services/adk/messages.py +164 -0
- agentex/lib/core/services/adk/providers/__init__.py +0 -0
- agentex/lib/core/services/adk/providers/litellm.py +256 -0
- agentex/lib/core/services/adk/providers/openai.py +723 -0
- agentex/lib/core/services/adk/providers/sgp.py +99 -0
- agentex/lib/core/services/adk/state.py +120 -0
- agentex/lib/core/services/adk/streaming.py +262 -0
- agentex/lib/core/services/adk/tasks.py +69 -0
- agentex/lib/core/services/adk/tracing.py +36 -0
- agentex/lib/core/services/adk/utils/__init__.py +0 -0
- agentex/lib/core/services/adk/utils/templating.py +58 -0
- agentex/lib/core/temporal/__init__.py +0 -0
- agentex/lib/core/temporal/activities/__init__.py +207 -0
- agentex/lib/core/temporal/activities/activity_helpers.py +37 -0
- agentex/lib/core/temporal/activities/adk/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/acp/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/acp/acp_activities.py +86 -0
- agentex/lib/core/temporal/activities/adk/agent_task_tracker_activities.py +76 -0
- agentex/lib/core/temporal/activities/adk/agents_activities.py +35 -0
- agentex/lib/core/temporal/activities/adk/events_activities.py +50 -0
- agentex/lib/core/temporal/activities/adk/messages_activities.py +94 -0
- agentex/lib/core/temporal/activities/adk/providers/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/providers/litellm_activities.py +71 -0
- agentex/lib/core/temporal/activities/adk/providers/openai_activities.py +210 -0
- agentex/lib/core/temporal/activities/adk/providers/sgp_activities.py +42 -0
- agentex/lib/core/temporal/activities/adk/state_activities.py +85 -0
- agentex/lib/core/temporal/activities/adk/streaming_activities.py +33 -0
- agentex/lib/core/temporal/activities/adk/tasks_activities.py +48 -0
- agentex/lib/core/temporal/activities/adk/tracing_activities.py +55 -0
- agentex/lib/core/temporal/activities/adk/utils/__init__.py +0 -0
- agentex/lib/core/temporal/activities/adk/utils/templating_activities.py +41 -0
- agentex/lib/core/temporal/services/__init__.py +0 -0
- agentex/lib/core/temporal/services/temporal_task_service.py +69 -0
- agentex/lib/core/temporal/types/__init__.py +0 -0
- agentex/lib/core/temporal/types/workflow.py +5 -0
- agentex/lib/core/temporal/workers/__init__.py +0 -0
- agentex/lib/core/temporal/workers/worker.py +162 -0
- agentex/lib/core/temporal/workflows/workflow.py +26 -0
- agentex/lib/core/tracing/__init__.py +5 -0
- agentex/lib/core/tracing/processors/agentex_tracing_processor.py +117 -0
- agentex/lib/core/tracing/processors/sgp_tracing_processor.py +119 -0
- agentex/lib/core/tracing/processors/tracing_processor_interface.py +40 -0
- agentex/lib/core/tracing/trace.py +311 -0
- agentex/lib/core/tracing/tracer.py +70 -0
- agentex/lib/core/tracing/tracing_processor_manager.py +62 -0
- agentex/lib/environment_variables.py +87 -0
- agentex/lib/py.typed +0 -0
- agentex/lib/sdk/__init__.py +0 -0
- agentex/lib/sdk/config/__init__.py +0 -0
- agentex/lib/sdk/config/agent_config.py +61 -0
- agentex/lib/sdk/config/agent_manifest.py +219 -0
- agentex/lib/sdk/config/build_config.py +35 -0
- agentex/lib/sdk/config/deployment_config.py +117 -0
- agentex/lib/sdk/config/local_development_config.py +56 -0
- agentex/lib/sdk/config/project_config.py +103 -0
- agentex/lib/sdk/fastacp/__init__.py +3 -0
- agentex/lib/sdk/fastacp/base/base_acp_server.py +406 -0
- agentex/lib/sdk/fastacp/fastacp.py +74 -0
- agentex/lib/sdk/fastacp/impl/agentic_base_acp.py +72 -0
- agentex/lib/sdk/fastacp/impl/sync_acp.py +109 -0
- agentex/lib/sdk/fastacp/impl/temporal_acp.py +97 -0
- agentex/lib/sdk/fastacp/tests/README.md +297 -0
- agentex/lib/sdk/fastacp/tests/conftest.py +307 -0
- agentex/lib/sdk/fastacp/tests/pytest.ini +10 -0
- agentex/lib/sdk/fastacp/tests/run_tests.py +227 -0
- agentex/lib/sdk/fastacp/tests/test_base_acp_server.py +450 -0
- agentex/lib/sdk/fastacp/tests/test_fastacp_factory.py +344 -0
- agentex/lib/sdk/fastacp/tests/test_integration.py +477 -0
- agentex/lib/sdk/state_machine/__init__.py +6 -0
- agentex/lib/sdk/state_machine/noop_workflow.py +21 -0
- agentex/lib/sdk/state_machine/state.py +10 -0
- agentex/lib/sdk/state_machine/state_machine.py +189 -0
- agentex/lib/sdk/state_machine/state_workflow.py +16 -0
- agentex/lib/sdk/utils/__init__.py +0 -0
- agentex/lib/sdk/utils/messages.py +223 -0
- agentex/lib/types/__init__.py +0 -0
- agentex/lib/types/acp.py +94 -0
- agentex/lib/types/agent_configs.py +79 -0
- agentex/lib/types/agent_results.py +29 -0
- agentex/lib/types/credentials.py +34 -0
- agentex/lib/types/fastacp.py +61 -0
- agentex/lib/types/files.py +13 -0
- agentex/lib/types/json_rpc.py +49 -0
- agentex/lib/types/llm_messages.py +354 -0
- agentex/lib/types/task_message_updates.py +171 -0
- agentex/lib/types/tracing.py +34 -0
- agentex/lib/utils/__init__.py +0 -0
- agentex/lib/utils/completions.py +131 -0
- agentex/lib/utils/console.py +14 -0
- agentex/lib/utils/io.py +29 -0
- agentex/lib/utils/iterables.py +14 -0
- agentex/lib/utils/json_schema.py +23 -0
- agentex/lib/utils/logging.py +31 -0
- agentex/lib/utils/mcp.py +17 -0
- agentex/lib/utils/model_utils.py +46 -0
- agentex/lib/utils/parsing.py +15 -0
- agentex/lib/utils/regex.py +6 -0
- agentex/lib/utils/temporal.py +13 -0
- agentex/py.typed +0 -0
- agentex/resources/__init__.py +103 -0
- agentex/resources/agents.py +707 -0
- agentex/resources/events.py +294 -0
- agentex/resources/messages/__init__.py +33 -0
- agentex/resources/messages/batch.py +271 -0
- agentex/resources/messages/messages.py +492 -0
- agentex/resources/spans.py +557 -0
- agentex/resources/states.py +544 -0
- agentex/resources/tasks.py +615 -0
- agentex/resources/tracker.py +384 -0
- agentex/types/__init__.py +56 -0
- agentex/types/acp_type.py +7 -0
- agentex/types/agent.py +29 -0
- agentex/types/agent_list_params.py +13 -0
- agentex/types/agent_list_response.py +10 -0
- agentex/types/agent_rpc_by_name_params.py +21 -0
- agentex/types/agent_rpc_params.py +51 -0
- agentex/types/agent_rpc_params1.py +21 -0
- agentex/types/agent_rpc_response.py +20 -0
- agentex/types/agent_rpc_result.py +90 -0
- agentex/types/agent_task_tracker.py +34 -0
- agentex/types/data_content.py +30 -0
- agentex/types/data_content_param.py +31 -0
- agentex/types/data_delta.py +14 -0
- agentex/types/event.py +29 -0
- agentex/types/event_list_params.py +22 -0
- agentex/types/event_list_response.py +10 -0
- agentex/types/message_author.py +7 -0
- agentex/types/message_create_params.py +18 -0
- agentex/types/message_list_params.py +14 -0
- agentex/types/message_list_response.py +10 -0
- agentex/types/message_style.py +7 -0
- agentex/types/message_update_params.py +18 -0
- agentex/types/messages/__init__.py +8 -0
- agentex/types/messages/batch_create_params.py +16 -0
- agentex/types/messages/batch_create_response.py +10 -0
- agentex/types/messages/batch_update_params.py +16 -0
- agentex/types/messages/batch_update_response.py +10 -0
- agentex/types/shared/__init__.py +3 -0
- agentex/types/shared/task_message_update.py +83 -0
- agentex/types/span.py +36 -0
- agentex/types/span_create_params.py +40 -0
- agentex/types/span_list_params.py +12 -0
- agentex/types/span_list_response.py +10 -0
- agentex/types/span_update_params.py +37 -0
- agentex/types/state.py +25 -0
- agentex/types/state_create_params.py +16 -0
- agentex/types/state_list_params.py +16 -0
- agentex/types/state_list_response.py +10 -0
- agentex/types/state_update_params.py +16 -0
- agentex/types/task.py +23 -0
- agentex/types/task_delete_by_name_response.py +8 -0
- agentex/types/task_delete_response.py +8 -0
- agentex/types/task_list_response.py +10 -0
- agentex/types/task_message.py +33 -0
- agentex/types/task_message_content.py +16 -0
- agentex/types/task_message_content_param.py +17 -0
- agentex/types/task_message_delta.py +16 -0
- agentex/types/text_content.py +53 -0
- agentex/types/text_content_param.py +54 -0
- agentex/types/text_delta.py +14 -0
- agentex/types/tool_request_content.py +36 -0
- agentex/types/tool_request_content_param.py +37 -0
- agentex/types/tool_request_delta.py +18 -0
- agentex/types/tool_response_content.py +36 -0
- agentex/types/tool_response_content_param.py +36 -0
- agentex/types/tool_response_delta.py +18 -0
- agentex/types/tracker_list_params.py +16 -0
- agentex/types/tracker_list_response.py +10 -0
- agentex/types/tracker_update_params.py +19 -0
- agentex_sdk-0.1.0.dist-info/METADATA +423 -0
- agentex_sdk-0.1.0.dist-info/RECORD +289 -0
- agentex_sdk-0.1.0.dist-info/WHEEL +4 -0
- agentex_sdk-0.1.0.dist-info/entry_points.txt +2 -0
- agentex_sdk-0.1.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,90 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List, Union, Optional
|
4
|
+
from typing_extensions import Literal, TypeAlias
|
5
|
+
|
6
|
+
from .task import Task
|
7
|
+
from .event import Event
|
8
|
+
from .._models import BaseModel
|
9
|
+
from .task_message import TaskMessage
|
10
|
+
from .task_message_delta import TaskMessageDelta
|
11
|
+
from .task_message_content import TaskMessageContent
|
12
|
+
|
13
|
+
__all__ = [
|
14
|
+
"AgentRpcResult",
|
15
|
+
"StreamTaskMessageStart",
|
16
|
+
"StreamTaskMessageDelta",
|
17
|
+
"StreamTaskMessageFull",
|
18
|
+
"StreamTaskMessageDone",
|
19
|
+
]
|
20
|
+
|
21
|
+
|
22
|
+
class StreamTaskMessageStart(BaseModel):
|
23
|
+
content: TaskMessageContent
|
24
|
+
|
25
|
+
index: Optional[int] = None
|
26
|
+
|
27
|
+
parent_task_message: Optional[TaskMessage] = None
|
28
|
+
"""Represents a message in the agent system.
|
29
|
+
|
30
|
+
This entity is used to store messages in MongoDB, with each message associated
|
31
|
+
with a specific task.
|
32
|
+
"""
|
33
|
+
|
34
|
+
type: Optional[Literal["start"]] = None
|
35
|
+
|
36
|
+
|
37
|
+
class StreamTaskMessageDelta(BaseModel):
|
38
|
+
delta: Optional[TaskMessageDelta] = None
|
39
|
+
"""Delta for text updates"""
|
40
|
+
|
41
|
+
index: Optional[int] = None
|
42
|
+
|
43
|
+
parent_task_message: Optional[TaskMessage] = None
|
44
|
+
"""Represents a message in the agent system.
|
45
|
+
|
46
|
+
This entity is used to store messages in MongoDB, with each message associated
|
47
|
+
with a specific task.
|
48
|
+
"""
|
49
|
+
|
50
|
+
type: Optional[Literal["delta"]] = None
|
51
|
+
|
52
|
+
|
53
|
+
class StreamTaskMessageFull(BaseModel):
|
54
|
+
content: TaskMessageContent
|
55
|
+
|
56
|
+
index: Optional[int] = None
|
57
|
+
|
58
|
+
parent_task_message: Optional[TaskMessage] = None
|
59
|
+
"""Represents a message in the agent system.
|
60
|
+
|
61
|
+
This entity is used to store messages in MongoDB, with each message associated
|
62
|
+
with a specific task.
|
63
|
+
"""
|
64
|
+
|
65
|
+
type: Optional[Literal["full"]] = None
|
66
|
+
|
67
|
+
|
68
|
+
class StreamTaskMessageDone(BaseModel):
|
69
|
+
index: Optional[int] = None
|
70
|
+
|
71
|
+
parent_task_message: Optional[TaskMessage] = None
|
72
|
+
"""Represents a message in the agent system.
|
73
|
+
|
74
|
+
This entity is used to store messages in MongoDB, with each message associated
|
75
|
+
with a specific task.
|
76
|
+
"""
|
77
|
+
|
78
|
+
type: Optional[Literal["done"]] = None
|
79
|
+
|
80
|
+
|
81
|
+
AgentRpcResult: TypeAlias = Union[
|
82
|
+
List[TaskMessage],
|
83
|
+
StreamTaskMessageStart,
|
84
|
+
StreamTaskMessageDelta,
|
85
|
+
StreamTaskMessageFull,
|
86
|
+
StreamTaskMessageDone,
|
87
|
+
Task,
|
88
|
+
Event,
|
89
|
+
None,
|
90
|
+
]
|
@@ -0,0 +1,34 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["AgentTaskTracker"]
|
9
|
+
|
10
|
+
|
11
|
+
class AgentTaskTracker(BaseModel):
|
12
|
+
id: str
|
13
|
+
"""The UUID of the agent task tracker"""
|
14
|
+
|
15
|
+
agent_id: str
|
16
|
+
"""The UUID of the agent"""
|
17
|
+
|
18
|
+
created_at: datetime
|
19
|
+
"""When the agent task tracker was created"""
|
20
|
+
|
21
|
+
task_id: str
|
22
|
+
"""The UUID of the task"""
|
23
|
+
|
24
|
+
last_processed_event_id: Optional[str] = None
|
25
|
+
"""The last processed event ID"""
|
26
|
+
|
27
|
+
status: Optional[str] = None
|
28
|
+
"""Processing status"""
|
29
|
+
|
30
|
+
status_reason: Optional[str] = None
|
31
|
+
"""Optional status reason"""
|
32
|
+
|
33
|
+
updated_at: Optional[datetime] = None
|
34
|
+
"""When the agent task tracker was last updated"""
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
from .message_style import MessageStyle
|
8
|
+
from .message_author import MessageAuthor
|
9
|
+
|
10
|
+
__all__ = ["DataContent"]
|
11
|
+
|
12
|
+
|
13
|
+
class DataContent(BaseModel):
|
14
|
+
author: MessageAuthor
|
15
|
+
"""
|
16
|
+
The role of the messages author, in this case `system`, `user`, `assistant`, or
|
17
|
+
`tool`.
|
18
|
+
"""
|
19
|
+
|
20
|
+
data: Dict[str, object]
|
21
|
+
"""The contents of the data message."""
|
22
|
+
|
23
|
+
style: MessageStyle = "static"
|
24
|
+
"""The style of the message.
|
25
|
+
|
26
|
+
This is used by the client to determine how to display the message.
|
27
|
+
"""
|
28
|
+
|
29
|
+
type: Literal["data"] = "data"
|
30
|
+
"""The type of the message, in this case `data`."""
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
7
|
+
|
8
|
+
from .message_style import MessageStyle
|
9
|
+
from .message_author import MessageAuthor
|
10
|
+
|
11
|
+
__all__ = ["DataContentParam"]
|
12
|
+
|
13
|
+
|
14
|
+
class DataContentParam(TypedDict, total=False):
|
15
|
+
author: Required[MessageAuthor]
|
16
|
+
"""
|
17
|
+
The role of the messages author, in this case `system`, `user`, `assistant`, or
|
18
|
+
`tool`.
|
19
|
+
"""
|
20
|
+
|
21
|
+
data: Required[Dict[str, object]]
|
22
|
+
"""The contents of the data message."""
|
23
|
+
|
24
|
+
style: MessageStyle
|
25
|
+
"""The style of the message.
|
26
|
+
|
27
|
+
This is used by the client to determine how to display the message.
|
28
|
+
"""
|
29
|
+
|
30
|
+
type: Literal["data"]
|
31
|
+
"""The type of the message, in this case `data`."""
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
from typing_extensions import Literal
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["DataDelta"]
|
9
|
+
|
10
|
+
|
11
|
+
class DataDelta(BaseModel):
|
12
|
+
data_delta: Optional[str] = None
|
13
|
+
|
14
|
+
type: Optional[Literal["data"]] = None
|
agentex/types/event.py
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
from .task_message_content import TaskMessageContent
|
8
|
+
|
9
|
+
__all__ = ["Event"]
|
10
|
+
|
11
|
+
|
12
|
+
class Event(BaseModel):
|
13
|
+
id: str
|
14
|
+
"""The UUID of the event"""
|
15
|
+
|
16
|
+
agent_id: str
|
17
|
+
"""The UUID of the agent that the event belongs to"""
|
18
|
+
|
19
|
+
sequence_id: int
|
20
|
+
"""The sequence ID of the event"""
|
21
|
+
|
22
|
+
task_id: str
|
23
|
+
"""The UUID of the task that the event belongs to"""
|
24
|
+
|
25
|
+
content: Optional[TaskMessageContent] = None
|
26
|
+
"""The content of the event"""
|
27
|
+
|
28
|
+
created_at: Optional[datetime] = None
|
29
|
+
"""The timestamp of the event"""
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
from typing_extensions import Required, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["EventListParams"]
|
9
|
+
|
10
|
+
|
11
|
+
class EventListParams(TypedDict, total=False):
|
12
|
+
agent_id: Required[str]
|
13
|
+
"""The agent ID to filter events by"""
|
14
|
+
|
15
|
+
task_id: Required[str]
|
16
|
+
"""The task ID to filter events by"""
|
17
|
+
|
18
|
+
last_processed_event_id: Optional[str]
|
19
|
+
"""Optional event ID to get events after this ID"""
|
20
|
+
|
21
|
+
limit: Optional[int]
|
22
|
+
"""Optional limit on number of results"""
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
from typing_extensions import TypeAlias
|
5
|
+
|
6
|
+
from .event import Event
|
7
|
+
|
8
|
+
__all__ = ["EventListResponse"]
|
9
|
+
|
10
|
+
EventListResponse: TypeAlias = List[Event]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
7
|
+
|
8
|
+
from .task_message_content_param import TaskMessageContentParam
|
9
|
+
|
10
|
+
__all__ = ["MessageCreateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class MessageCreateParams(TypedDict, total=False):
|
14
|
+
content: Required[TaskMessageContentParam]
|
15
|
+
|
16
|
+
task_id: Required[str]
|
17
|
+
|
18
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
from typing_extensions import Required, TypedDict
|
7
|
+
|
8
|
+
__all__ = ["MessageListParams"]
|
9
|
+
|
10
|
+
|
11
|
+
class MessageListParams(TypedDict, total=False):
|
12
|
+
task_id: Required[str]
|
13
|
+
|
14
|
+
limit: Optional[int]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
from typing_extensions import TypeAlias
|
5
|
+
|
6
|
+
from .task_message import TaskMessage
|
7
|
+
|
8
|
+
__all__ = ["MessageListResponse"]
|
9
|
+
|
10
|
+
MessageListResponse: TypeAlias = List[TaskMessage]
|
@@ -0,0 +1,18 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
from typing_extensions import Literal, Required, TypedDict
|
7
|
+
|
8
|
+
from .task_message_content_param import TaskMessageContentParam
|
9
|
+
|
10
|
+
__all__ = ["MessageUpdateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class MessageUpdateParams(TypedDict, total=False):
|
14
|
+
content: Required[TaskMessageContentParam]
|
15
|
+
|
16
|
+
task_id: Required[str]
|
17
|
+
|
18
|
+
streaming_status: Optional[Literal["IN_PROGRESS", "DONE"]]
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from .batch_create_params import BatchCreateParams as BatchCreateParams
|
6
|
+
from .batch_update_params import BatchUpdateParams as BatchUpdateParams
|
7
|
+
from .batch_create_response import BatchCreateResponse as BatchCreateResponse
|
8
|
+
from .batch_update_response import BatchUpdateResponse as BatchUpdateResponse
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Iterable
|
6
|
+
from typing_extensions import Required, TypedDict
|
7
|
+
|
8
|
+
from ..task_message_content_param import TaskMessageContentParam
|
9
|
+
|
10
|
+
__all__ = ["BatchCreateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class BatchCreateParams(TypedDict, total=False):
|
14
|
+
contents: Required[Iterable[TaskMessageContentParam]]
|
15
|
+
|
16
|
+
task_id: Required[str]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
from typing_extensions import TypeAlias
|
5
|
+
|
6
|
+
from ..task_message import TaskMessage
|
7
|
+
|
8
|
+
__all__ = ["BatchCreateResponse"]
|
9
|
+
|
10
|
+
BatchCreateResponse: TypeAlias = List[TaskMessage]
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict
|
6
|
+
from typing_extensions import Required, TypedDict
|
7
|
+
|
8
|
+
from ..task_message_content_param import TaskMessageContentParam
|
9
|
+
|
10
|
+
__all__ = ["BatchUpdateParams"]
|
11
|
+
|
12
|
+
|
13
|
+
class BatchUpdateParams(TypedDict, total=False):
|
14
|
+
task_id: Required[str]
|
15
|
+
|
16
|
+
updates: Required[Dict[str, TaskMessageContentParam]]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
from typing_extensions import TypeAlias
|
5
|
+
|
6
|
+
from ..task_message import TaskMessage
|
7
|
+
|
8
|
+
__all__ = ["BatchUpdateResponse"]
|
9
|
+
|
10
|
+
BatchUpdateResponse: TypeAlias = List[TaskMessage]
|
@@ -0,0 +1,83 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Union, Optional
|
4
|
+
from typing_extensions import Literal, Annotated, TypeAlias
|
5
|
+
|
6
|
+
from ..._utils import PropertyInfo
|
7
|
+
from ..._models import BaseModel
|
8
|
+
from ..task_message import TaskMessage
|
9
|
+
from ..task_message_delta import TaskMessageDelta
|
10
|
+
from ..task_message_content import TaskMessageContent
|
11
|
+
|
12
|
+
__all__ = [
|
13
|
+
"TaskMessageUpdate",
|
14
|
+
"StreamTaskMessageStart",
|
15
|
+
"StreamTaskMessageDelta",
|
16
|
+
"StreamTaskMessageFull",
|
17
|
+
"StreamTaskMessageDone",
|
18
|
+
]
|
19
|
+
|
20
|
+
|
21
|
+
class StreamTaskMessageStart(BaseModel):
|
22
|
+
content: TaskMessageContent
|
23
|
+
|
24
|
+
index: Optional[int] = None
|
25
|
+
|
26
|
+
parent_task_message: Optional[TaskMessage] = None
|
27
|
+
"""Represents a message in the agent system.
|
28
|
+
|
29
|
+
This entity is used to store messages in MongoDB, with each message associated
|
30
|
+
with a specific task.
|
31
|
+
"""
|
32
|
+
|
33
|
+
type: Optional[Literal["start"]] = None
|
34
|
+
|
35
|
+
|
36
|
+
class StreamTaskMessageDelta(BaseModel):
|
37
|
+
delta: Optional[TaskMessageDelta] = None
|
38
|
+
"""Delta for text updates"""
|
39
|
+
|
40
|
+
index: Optional[int] = None
|
41
|
+
|
42
|
+
parent_task_message: Optional[TaskMessage] = None
|
43
|
+
"""Represents a message in the agent system.
|
44
|
+
|
45
|
+
This entity is used to store messages in MongoDB, with each message associated
|
46
|
+
with a specific task.
|
47
|
+
"""
|
48
|
+
|
49
|
+
type: Optional[Literal["delta"]] = None
|
50
|
+
|
51
|
+
|
52
|
+
class StreamTaskMessageFull(BaseModel):
|
53
|
+
content: TaskMessageContent
|
54
|
+
|
55
|
+
index: Optional[int] = None
|
56
|
+
|
57
|
+
parent_task_message: Optional[TaskMessage] = None
|
58
|
+
"""Represents a message in the agent system.
|
59
|
+
|
60
|
+
This entity is used to store messages in MongoDB, with each message associated
|
61
|
+
with a specific task.
|
62
|
+
"""
|
63
|
+
|
64
|
+
type: Optional[Literal["full"]] = None
|
65
|
+
|
66
|
+
|
67
|
+
class StreamTaskMessageDone(BaseModel):
|
68
|
+
index: Optional[int] = None
|
69
|
+
|
70
|
+
parent_task_message: Optional[TaskMessage] = None
|
71
|
+
"""Represents a message in the agent system.
|
72
|
+
|
73
|
+
This entity is used to store messages in MongoDB, with each message associated
|
74
|
+
with a specific task.
|
75
|
+
"""
|
76
|
+
|
77
|
+
type: Optional[Literal["done"]] = None
|
78
|
+
|
79
|
+
|
80
|
+
TaskMessageUpdate: TypeAlias = Annotated[
|
81
|
+
Union[StreamTaskMessageStart, StreamTaskMessageDelta, StreamTaskMessageFull, StreamTaskMessageDone],
|
82
|
+
PropertyInfo(discriminator="type"),
|
83
|
+
]
|
agentex/types/span.py
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, List, Union, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["Span"]
|
9
|
+
|
10
|
+
|
11
|
+
class Span(BaseModel):
|
12
|
+
id: str
|
13
|
+
|
14
|
+
name: str
|
15
|
+
"""Name that describes what operation this span represents"""
|
16
|
+
|
17
|
+
start_time: datetime
|
18
|
+
"""The time the span started"""
|
19
|
+
|
20
|
+
trace_id: str
|
21
|
+
"""Unique identifier for the trace this span belongs to"""
|
22
|
+
|
23
|
+
data: Union[Dict[str, object], List[Dict[str, object]], None] = None
|
24
|
+
"""Any additional metadata or context for the span"""
|
25
|
+
|
26
|
+
end_time: Optional[datetime] = None
|
27
|
+
"""The time the span ended"""
|
28
|
+
|
29
|
+
input: Union[Dict[str, object], List[Dict[str, object]], None] = None
|
30
|
+
"""Input parameters or data for the operation"""
|
31
|
+
|
32
|
+
output: Union[Dict[str, object], List[Dict[str, object]], None] = None
|
33
|
+
"""Output data resulting from the operation"""
|
34
|
+
|
35
|
+
parent_id: Optional[str] = None
|
36
|
+
"""ID of the parent span if this is a child span in a trace"""
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
6
|
+
from datetime import datetime
|
7
|
+
from typing_extensions import Required, Annotated, TypedDict
|
8
|
+
|
9
|
+
from .._utils import PropertyInfo
|
10
|
+
|
11
|
+
__all__ = ["SpanCreateParams"]
|
12
|
+
|
13
|
+
|
14
|
+
class SpanCreateParams(TypedDict, total=False):
|
15
|
+
name: Required[str]
|
16
|
+
"""Name that describes what operation this span represents"""
|
17
|
+
|
18
|
+
start_time: Required[Annotated[Union[str, datetime], PropertyInfo(format="iso8601")]]
|
19
|
+
"""The time the span started"""
|
20
|
+
|
21
|
+
trace_id: Required[str]
|
22
|
+
"""Unique identifier for the trace this span belongs to"""
|
23
|
+
|
24
|
+
id: Optional[str]
|
25
|
+
"""Unique identifier for the span. If not provided, an ID will be generated."""
|
26
|
+
|
27
|
+
data: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
28
|
+
"""Any additional metadata or context for the span"""
|
29
|
+
|
30
|
+
end_time: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
|
31
|
+
"""The time the span ended"""
|
32
|
+
|
33
|
+
input: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
34
|
+
"""Input parameters or data for the operation"""
|
35
|
+
|
36
|
+
output: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
37
|
+
"""Output data resulting from the operation"""
|
38
|
+
|
39
|
+
parent_id: Optional[str]
|
40
|
+
"""ID of the parent span if this is a child span in a trace"""
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Optional
|
6
|
+
from typing_extensions import TypedDict
|
7
|
+
|
8
|
+
__all__ = ["SpanListParams"]
|
9
|
+
|
10
|
+
|
11
|
+
class SpanListParams(TypedDict, total=False):
|
12
|
+
trace_id: Optional[str]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import List
|
4
|
+
from typing_extensions import TypeAlias
|
5
|
+
|
6
|
+
from .span import Span
|
7
|
+
|
8
|
+
__all__ = ["SpanListResponse"]
|
9
|
+
|
10
|
+
SpanListResponse: TypeAlias = List[Span]
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from typing import Dict, Union, Iterable, Optional
|
6
|
+
from datetime import datetime
|
7
|
+
from typing_extensions import Annotated, TypedDict
|
8
|
+
|
9
|
+
from .._utils import PropertyInfo
|
10
|
+
|
11
|
+
__all__ = ["SpanUpdateParams"]
|
12
|
+
|
13
|
+
|
14
|
+
class SpanUpdateParams(TypedDict, total=False):
|
15
|
+
data: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
16
|
+
"""Any additional metadata or context for the span"""
|
17
|
+
|
18
|
+
end_time: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
|
19
|
+
"""The time the span ended"""
|
20
|
+
|
21
|
+
input: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
22
|
+
"""Input parameters or data for the operation"""
|
23
|
+
|
24
|
+
name: Optional[str]
|
25
|
+
"""Name that describes what operation this span represents"""
|
26
|
+
|
27
|
+
output: Union[Dict[str, object], Iterable[Dict[str, object]], None]
|
28
|
+
"""Output data resulting from the operation"""
|
29
|
+
|
30
|
+
parent_id: Optional[str]
|
31
|
+
"""ID of the parent span if this is a child span in a trace"""
|
32
|
+
|
33
|
+
start_time: Annotated[Union[str, datetime, None], PropertyInfo(format="iso8601")]
|
34
|
+
"""The time the span started"""
|
35
|
+
|
36
|
+
trace_id: Optional[str]
|
37
|
+
"""Unique identifier for the trace this span belongs to"""
|
agentex/types/state.py
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
2
|
+
|
3
|
+
from typing import Dict, Optional
|
4
|
+
from datetime import datetime
|
5
|
+
|
6
|
+
from .._models import BaseModel
|
7
|
+
|
8
|
+
__all__ = ["State"]
|
9
|
+
|
10
|
+
|
11
|
+
class State(BaseModel):
|
12
|
+
id: str
|
13
|
+
"""The task state's unique id"""
|
14
|
+
|
15
|
+
agent_id: str
|
16
|
+
|
17
|
+
created_at: datetime
|
18
|
+
"""The timestamp when the state was created"""
|
19
|
+
|
20
|
+
state: Dict[str, object]
|
21
|
+
|
22
|
+
task_id: str
|
23
|
+
|
24
|
+
updated_at: Optional[datetime] = None
|
25
|
+
"""The timestamp when the state was last updated"""
|