idun-agent-schema 0.1.4__py3-none-any.whl → 0.1.5__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.
Potentially problematic release.
This version of idun-agent-schema might be problematic. Click here for more details.
- idun_agent_schema/__init__.py +10 -10
- idun_agent_schema/engine/__init__.py +11 -12
- idun_agent_schema/engine/agent.py +16 -16
- idun_agent_schema/engine/api.py +29 -29
- idun_agent_schema/engine/config.py +5 -9
- idun_agent_schema/engine/haystack.py +13 -13
- idun_agent_schema/engine/langgraph.py +47 -47
- idun_agent_schema/engine/server.py +15 -15
- idun_agent_schema/manager/__init__.py +50 -50
- idun_agent_schema/manager/api.py +158 -158
- idun_agent_schema/manager/deployments.py +12 -12
- idun_agent_schema/manager/deps.py +14 -14
- idun_agent_schema/manager/domain.py +276 -276
- idun_agent_schema/manager/dto.py +131 -131
- idun_agent_schema/manager/errors.py +22 -22
- idun_agent_schema/manager/settings.py +161 -161
- idun_agent_schema/shared/__init__.py +5 -5
- idun_agent_schema/shared/observability.py +56 -56
- {idun_agent_schema-0.1.4.dist-info → idun_agent_schema-0.1.5.dist-info}/METADATA +1 -1
- idun_agent_schema-0.1.5.dist-info/RECORD +22 -0
- idun_agent_schema-0.1.4.dist-info/RECORD +0 -22
- {idun_agent_schema-0.1.4.dist-info → idun_agent_schema-0.1.5.dist-info}/WHEEL +0 -0
idun_agent_schema/manager/api.py
CHANGED
|
@@ -1,158 +1,158 @@
|
|
|
1
|
-
"""Pydantic schemas for Agent Manager API I/O."""
|
|
2
|
-
|
|
3
|
-
from datetime import datetime
|
|
4
|
-
from typing import Any
|
|
5
|
-
from uuid import UUID
|
|
6
|
-
|
|
7
|
-
from pydantic import BaseModel, Field
|
|
8
|
-
|
|
9
|
-
from .domain import AgentFramework, AgentStatus
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class AgentCreateRequest(BaseModel):
|
|
13
|
-
"""Request payload to create a new agent."""
|
|
14
|
-
|
|
15
|
-
name: str = Field(..., min_length=1, max_length=255)
|
|
16
|
-
description: str | None = Field(None, max_length=1000)
|
|
17
|
-
framework: AgentFramework
|
|
18
|
-
config: dict[str, Any] = Field(default_factory=dict)
|
|
19
|
-
environment_variables: dict[str, str] = Field(default_factory=dict)
|
|
20
|
-
tags: list[str] = Field(default_factory=list)
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
class AgentUpdateRequest(BaseModel):
|
|
24
|
-
"""Request payload to update an existing agent (partial)."""
|
|
25
|
-
|
|
26
|
-
name: str | None = Field(None, min_length=1, max_length=255)
|
|
27
|
-
description: str | None = Field(None, max_length=1000)
|
|
28
|
-
config: dict[str, Any] | None = None
|
|
29
|
-
environment_variables: dict[str, str] | None = None
|
|
30
|
-
tags: list[str] | None = None
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class AgentRunRequest(BaseModel):
|
|
34
|
-
"""Request payload to execute an agent run."""
|
|
35
|
-
|
|
36
|
-
input_data: dict[str, Any]
|
|
37
|
-
trace_id: str | None = Field(None, max_length=100)
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
class AgentResponse(BaseModel):
|
|
41
|
-
"""Response shape for a single agent resource."""
|
|
42
|
-
|
|
43
|
-
id: UUID
|
|
44
|
-
name: str
|
|
45
|
-
description: str | None
|
|
46
|
-
framework: AgentFramework
|
|
47
|
-
status: AgentStatus
|
|
48
|
-
config: dict[str, Any]
|
|
49
|
-
environment_variables: dict[str, str]
|
|
50
|
-
version: str
|
|
51
|
-
tags: list[str]
|
|
52
|
-
tenant_id: UUID
|
|
53
|
-
created_at: datetime
|
|
54
|
-
updated_at: datetime
|
|
55
|
-
deployed_at: datetime | None
|
|
56
|
-
total_runs: int
|
|
57
|
-
success_rate: float | None
|
|
58
|
-
avg_response_time_ms: float | None
|
|
59
|
-
|
|
60
|
-
class Config:
|
|
61
|
-
"""Pydantic configuration for ORM compatibility."""
|
|
62
|
-
|
|
63
|
-
from_attributes = True
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
class AgentSummaryResponse(BaseModel):
|
|
67
|
-
"""Reduced agent fields for listing views."""
|
|
68
|
-
|
|
69
|
-
id: UUID
|
|
70
|
-
name: str
|
|
71
|
-
description: str | None
|
|
72
|
-
framework: AgentFramework
|
|
73
|
-
status: AgentStatus
|
|
74
|
-
version: str
|
|
75
|
-
tags: list[str]
|
|
76
|
-
created_at: datetime
|
|
77
|
-
updated_at: datetime
|
|
78
|
-
total_runs: int
|
|
79
|
-
success_rate: float | None
|
|
80
|
-
|
|
81
|
-
class Config:
|
|
82
|
-
"""Pydantic configuration for ORM compatibility."""
|
|
83
|
-
|
|
84
|
-
from_attributes = True
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
class AgentRunResponse(BaseModel):
|
|
88
|
-
"""Detailed run record returned after execution."""
|
|
89
|
-
|
|
90
|
-
id: UUID
|
|
91
|
-
agent_id: UUID
|
|
92
|
-
tenant_id: UUID
|
|
93
|
-
input_data: dict[str, Any]
|
|
94
|
-
output_data: dict[str, Any] | None
|
|
95
|
-
status: str
|
|
96
|
-
started_at: datetime
|
|
97
|
-
completed_at: datetime | None
|
|
98
|
-
error_message: str | None
|
|
99
|
-
response_time_ms: float | None
|
|
100
|
-
tokens_used: int | None
|
|
101
|
-
cost_usd: float | None
|
|
102
|
-
trace_id: str | None
|
|
103
|
-
span_id: str | None
|
|
104
|
-
|
|
105
|
-
class Config:
|
|
106
|
-
"""Pydantic configuration for ORM compatibility."""
|
|
107
|
-
|
|
108
|
-
from_attributes = True
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
class AgentRunSummaryResponse(BaseModel):
|
|
112
|
-
"""Reduced run fields for list views."""
|
|
113
|
-
|
|
114
|
-
id: UUID
|
|
115
|
-
agent_id: UUID
|
|
116
|
-
status: str
|
|
117
|
-
started_at: datetime
|
|
118
|
-
completed_at: datetime | None
|
|
119
|
-
response_time_ms: float | None
|
|
120
|
-
tokens_used: int | None
|
|
121
|
-
cost_usd: float | None
|
|
122
|
-
|
|
123
|
-
class Config:
|
|
124
|
-
"""Pydantic configuration for ORM compatibility."""
|
|
125
|
-
|
|
126
|
-
from_attributes = True
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
class PaginatedResponse(BaseModel):
|
|
130
|
-
"""Base pagination container used by list endpoints."""
|
|
131
|
-
|
|
132
|
-
total: int
|
|
133
|
-
limit: int
|
|
134
|
-
offset: int
|
|
135
|
-
has_more: bool
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
class PaginatedAgentsResponse(PaginatedResponse):
|
|
139
|
-
"""Paginated list of agents."""
|
|
140
|
-
|
|
141
|
-
items: list[AgentSummaryResponse]
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
class PaginatedRunsResponse(PaginatedResponse):
|
|
145
|
-
"""Paginated list of agent runs."""
|
|
146
|
-
|
|
147
|
-
items: list[AgentRunSummaryResponse]
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
class AgentStatsResponse(BaseModel):
|
|
151
|
-
"""Aggregated statistics across all agents."""
|
|
152
|
-
|
|
153
|
-
total_agents: int
|
|
154
|
-
active_agents: int
|
|
155
|
-
total_runs_today: int
|
|
156
|
-
total_runs_this_month: int
|
|
157
|
-
avg_success_rate: float | None
|
|
158
|
-
avg_response_time_ms: float | None
|
|
1
|
+
"""Pydantic schemas for Agent Manager API I/O."""
|
|
2
|
+
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from typing import Any
|
|
5
|
+
from uuid import UUID
|
|
6
|
+
|
|
7
|
+
from pydantic import BaseModel, Field
|
|
8
|
+
|
|
9
|
+
from .domain import AgentFramework, AgentStatus
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AgentCreateRequest(BaseModel):
|
|
13
|
+
"""Request payload to create a new agent."""
|
|
14
|
+
|
|
15
|
+
name: str = Field(..., min_length=1, max_length=255)
|
|
16
|
+
description: str | None = Field(None, max_length=1000)
|
|
17
|
+
framework: AgentFramework
|
|
18
|
+
config: dict[str, Any] = Field(default_factory=dict)
|
|
19
|
+
environment_variables: dict[str, str] = Field(default_factory=dict)
|
|
20
|
+
tags: list[str] = Field(default_factory=list)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class AgentUpdateRequest(BaseModel):
|
|
24
|
+
"""Request payload to update an existing agent (partial)."""
|
|
25
|
+
|
|
26
|
+
name: str | None = Field(None, min_length=1, max_length=255)
|
|
27
|
+
description: str | None = Field(None, max_length=1000)
|
|
28
|
+
config: dict[str, Any] | None = None
|
|
29
|
+
environment_variables: dict[str, str] | None = None
|
|
30
|
+
tags: list[str] | None = None
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class AgentRunRequest(BaseModel):
|
|
34
|
+
"""Request payload to execute an agent run."""
|
|
35
|
+
|
|
36
|
+
input_data: dict[str, Any]
|
|
37
|
+
trace_id: str | None = Field(None, max_length=100)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class AgentResponse(BaseModel):
|
|
41
|
+
"""Response shape for a single agent resource."""
|
|
42
|
+
|
|
43
|
+
id: UUID
|
|
44
|
+
name: str
|
|
45
|
+
description: str | None
|
|
46
|
+
framework: AgentFramework
|
|
47
|
+
status: AgentStatus
|
|
48
|
+
config: dict[str, Any]
|
|
49
|
+
environment_variables: dict[str, str]
|
|
50
|
+
version: str
|
|
51
|
+
tags: list[str]
|
|
52
|
+
tenant_id: UUID
|
|
53
|
+
created_at: datetime
|
|
54
|
+
updated_at: datetime
|
|
55
|
+
deployed_at: datetime | None
|
|
56
|
+
total_runs: int
|
|
57
|
+
success_rate: float | None
|
|
58
|
+
avg_response_time_ms: float | None
|
|
59
|
+
|
|
60
|
+
class Config:
|
|
61
|
+
"""Pydantic configuration for ORM compatibility."""
|
|
62
|
+
|
|
63
|
+
from_attributes = True
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
class AgentSummaryResponse(BaseModel):
|
|
67
|
+
"""Reduced agent fields for listing views."""
|
|
68
|
+
|
|
69
|
+
id: UUID
|
|
70
|
+
name: str
|
|
71
|
+
description: str | None
|
|
72
|
+
framework: AgentFramework
|
|
73
|
+
status: AgentStatus
|
|
74
|
+
version: str
|
|
75
|
+
tags: list[str]
|
|
76
|
+
created_at: datetime
|
|
77
|
+
updated_at: datetime
|
|
78
|
+
total_runs: int
|
|
79
|
+
success_rate: float | None
|
|
80
|
+
|
|
81
|
+
class Config:
|
|
82
|
+
"""Pydantic configuration for ORM compatibility."""
|
|
83
|
+
|
|
84
|
+
from_attributes = True
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
class AgentRunResponse(BaseModel):
|
|
88
|
+
"""Detailed run record returned after execution."""
|
|
89
|
+
|
|
90
|
+
id: UUID
|
|
91
|
+
agent_id: UUID
|
|
92
|
+
tenant_id: UUID
|
|
93
|
+
input_data: dict[str, Any]
|
|
94
|
+
output_data: dict[str, Any] | None
|
|
95
|
+
status: str
|
|
96
|
+
started_at: datetime
|
|
97
|
+
completed_at: datetime | None
|
|
98
|
+
error_message: str | None
|
|
99
|
+
response_time_ms: float | None
|
|
100
|
+
tokens_used: int | None
|
|
101
|
+
cost_usd: float | None
|
|
102
|
+
trace_id: str | None
|
|
103
|
+
span_id: str | None
|
|
104
|
+
|
|
105
|
+
class Config:
|
|
106
|
+
"""Pydantic configuration for ORM compatibility."""
|
|
107
|
+
|
|
108
|
+
from_attributes = True
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
class AgentRunSummaryResponse(BaseModel):
|
|
112
|
+
"""Reduced run fields for list views."""
|
|
113
|
+
|
|
114
|
+
id: UUID
|
|
115
|
+
agent_id: UUID
|
|
116
|
+
status: str
|
|
117
|
+
started_at: datetime
|
|
118
|
+
completed_at: datetime | None
|
|
119
|
+
response_time_ms: float | None
|
|
120
|
+
tokens_used: int | None
|
|
121
|
+
cost_usd: float | None
|
|
122
|
+
|
|
123
|
+
class Config:
|
|
124
|
+
"""Pydantic configuration for ORM compatibility."""
|
|
125
|
+
|
|
126
|
+
from_attributes = True
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
class PaginatedResponse(BaseModel):
|
|
130
|
+
"""Base pagination container used by list endpoints."""
|
|
131
|
+
|
|
132
|
+
total: int
|
|
133
|
+
limit: int
|
|
134
|
+
offset: int
|
|
135
|
+
has_more: bool
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
class PaginatedAgentsResponse(PaginatedResponse):
|
|
139
|
+
"""Paginated list of agents."""
|
|
140
|
+
|
|
141
|
+
items: list[AgentSummaryResponse]
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
class PaginatedRunsResponse(PaginatedResponse):
|
|
145
|
+
"""Paginated list of agent runs."""
|
|
146
|
+
|
|
147
|
+
items: list[AgentRunSummaryResponse]
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
class AgentStatsResponse(BaseModel):
|
|
151
|
+
"""Aggregated statistics across all agents."""
|
|
152
|
+
|
|
153
|
+
total_agents: int
|
|
154
|
+
active_agents: int
|
|
155
|
+
total_runs_today: int
|
|
156
|
+
total_runs_this_month: int
|
|
157
|
+
avg_success_rate: float | None
|
|
158
|
+
avg_response_time_ms: float | None
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
"""Deployment-related enums and schemas."""
|
|
2
|
-
|
|
3
|
-
from enum import Enum
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class DeploymentMode(str, Enum):
|
|
7
|
-
"""Supported deployment modes."""
|
|
8
|
-
|
|
9
|
-
LOCAL = "local"
|
|
10
|
-
AWS = "aws"
|
|
11
|
-
AZURE = "azure"
|
|
12
|
-
GCP = "gcp"
|
|
1
|
+
"""Deployment-related enums and schemas."""
|
|
2
|
+
|
|
3
|
+
from enum import Enum
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class DeploymentMode(str, Enum):
|
|
7
|
+
"""Supported deployment modes."""
|
|
8
|
+
|
|
9
|
+
LOCAL = "local"
|
|
10
|
+
AWS = "aws"
|
|
11
|
+
AZURE = "azure"
|
|
12
|
+
GCP = "gcp"
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
"""Shared dependency models used by FastAPI deps in Manager."""
|
|
2
|
-
|
|
3
|
-
from uuid import UUID
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class Principal(BaseModel):
|
|
9
|
-
"""Authenticated caller identity and authorization context."""
|
|
10
|
-
|
|
11
|
-
user_id: str
|
|
12
|
-
tenant_id: UUID
|
|
13
|
-
roles: list[str] = []
|
|
14
|
-
workspace_ids: list[UUID] = []
|
|
1
|
+
"""Shared dependency models used by FastAPI deps in Manager."""
|
|
2
|
+
|
|
3
|
+
from uuid import UUID
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class Principal(BaseModel):
|
|
9
|
+
"""Authenticated caller identity and authorization context."""
|
|
10
|
+
|
|
11
|
+
user_id: str
|
|
12
|
+
tenant_id: UUID
|
|
13
|
+
roles: list[str] = []
|
|
14
|
+
workspace_ids: list[UUID] = []
|