idun-agent-schema 0.1.41__py3-none-any.whl → 0.2.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.

Potentially problematic release.


This version of idun-agent-schema might be problematic. Click here for more details.

@@ -2,8 +2,7 @@
2
2
 
3
3
  from .agent import BaseAgentConfig # noqa: F401
4
4
  from .api import ChatRequest, ChatResponse # noqa: F401
5
- from .config import AgentConfig, EngineConfig # noqa: F401
6
- from .haystack import HaystackAgentConfig
5
+ from .config import AgentConfig, AgentFramework, EngineConfig # noqa: F401
7
6
  from .langgraph import ( # noqa: F401
8
7
  CheckpointConfig,
9
8
  LangGraphAgentConfig,
@@ -1,25 +1,30 @@
1
1
  """Top-level engine configuration models."""
2
2
 
3
- from typing import Literal
4
-
3
+ from enum import Enum
5
4
  from pydantic import BaseModel, Field
6
5
 
7
- from idun_agent_schema.engine.haystack import HaystackAgentConfig
8
-
9
6
  from .agent import BaseAgentConfig
10
7
  from .langgraph import LangGraphAgentConfig
11
8
  from .server import ServerConfig
12
9
 
13
10
 
14
- class AgentConfig(BaseModel):
15
- """Configuration for agent specification and settings."""
11
+ class AgentFramework(str, Enum):
12
+ """Supported agent frameworks for engine."""
16
13
 
17
- type: Literal["langgraph", "ADK", "CREWAI", "haystack"] = Field(default="langgraph")
14
+ LANGGRAPH = "langgraph"
15
+ ADK = "ADK"
16
+ CREWAI = "CREWAI"
17
+ HAYSTACK = "haystack"
18
+ CUSTOM = "custom"
18
19
 
19
20
 
20
- config: BaseAgentConfig | HaystackAgentConfig | LangGraphAgentConfig = Field(
21
- default_factory=BaseAgentConfig
22
- )
21
+ class AgentConfig(BaseModel):
22
+ """Configuration for agent specification and settings."""
23
+
24
+ type: AgentFramework = Field(default=AgentFramework.LANGGRAPH)
25
+ config: BaseAgentConfig | LangGraphAgentConfig = Field(
26
+ default_factory=BaseAgentConfig
27
+ )
23
28
 
24
29
 
25
30
  class EngineConfig(BaseModel):
@@ -2,7 +2,7 @@
2
2
 
3
3
  from typing import Literal
4
4
 
5
- from .agent import BaseAgentConfig
5
+ from idun_agent_engine.core.engine_config import BaseAgentConfig
6
6
 
7
7
 
8
8
  class HaystackAgentConfig(BaseAgentConfig):
@@ -1,14 +1,17 @@
1
1
  """Manager-related schemas."""
2
2
 
3
3
  from .api import ( # noqa: F401
4
- AgentCreateRequest,
4
+ Agent,
5
+ AgentCreate,
6
+ AgentPatch,
7
+ AgentReplace,
5
8
  AgentResponse,
6
9
  AgentRunRequest,
7
10
  AgentRunResponse,
8
11
  AgentRunSummaryResponse,
9
12
  AgentStatsResponse,
10
13
  AgentSummaryResponse,
11
- AgentUpdateRequest,
14
+ AgentUpdate,
12
15
  PaginatedAgentsResponse,
13
16
  PaginatedResponse,
14
17
  PaginatedRunsResponse,
@@ -4,30 +4,12 @@ from datetime import datetime
4
4
  from typing import Any
5
5
  from uuid import UUID
6
6
 
7
- from pydantic import BaseModel, Field
7
+ from pydantic import BaseModel, Field, field_validator
8
8
 
9
+ from ..engine.config import AgentConfig
9
10
  from .domain import AgentFramework, AgentStatus
10
11
 
11
12
 
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
13
 
32
14
 
33
15
  class AgentRunRequest(BaseModel):
@@ -156,3 +138,149 @@ class AgentStatsResponse(BaseModel):
156
138
  total_runs_this_month: int
157
139
  avg_success_rate: float | None
158
140
  avg_response_time_ms: float | None
141
+
142
+
143
+ class AgentCreate(BaseModel):
144
+ """Schema for creating a new agent.
145
+
146
+ Framework is inferred from config.type (e.g., config.type = "langgraph").
147
+ """
148
+
149
+ name: str = Field(..., min_length=1, max_length=100, description="Agent name")
150
+ description: str | None = Field(
151
+ None, max_length=500, description="Agent description"
152
+ )
153
+ # Use schema's AgentConfig instead of AgentPayload
154
+ config: AgentConfig = Field(
155
+ ..., description="Framework-specific agent configuration"
156
+ )
157
+
158
+ @field_validator("name") # noqa: N805 - Pydantic validator uses `cls` by convention
159
+ @classmethod
160
+ def validate_name(cls, v):
161
+ if not v.strip():
162
+ raise ValueError("Name cannot be empty or whitespace only")
163
+ return v.strip()
164
+
165
+ class Config:
166
+ json_schema_extra = {
167
+ "example": {
168
+ "name": "My AI Assistant",
169
+ "description": "A helpful AI assistant for customer support",
170
+ "config": {
171
+ "type": "langgraph",
172
+ "config": {
173
+ "name": "My AI Assistant",
174
+ "graph_definition": "./examples/01_basic_config_file/example_agent.py:app",
175
+ "checkpointer": None,
176
+ "store": None,
177
+ "input_schema_definition": {},
178
+ "output_schema_definition": {},
179
+ "observability": None,
180
+ },
181
+ },
182
+ }
183
+ }
184
+
185
+
186
+ class AgentUpdate(BaseModel):
187
+ """Schema for updating an existing agent."""
188
+
189
+ name: str | None = Field(
190
+ None, min_length=1, max_length=100, description="Agent name"
191
+ )
192
+ description: str | None = Field(
193
+ None, max_length=500, description="Agent description"
194
+ )
195
+ framework: AgentFramework | None = Field(None, description="Agent framework")
196
+
197
+ @field_validator("name") # noqa: N805
198
+ @classmethod
199
+ def validate_name(cls, v):
200
+ if v is not None and not v.strip():
201
+ raise ValueError("Name cannot be empty or whitespace only")
202
+ return v.strip() if v else v
203
+
204
+ class Config:
205
+ json_schema_extra = {
206
+ "example": {
207
+ "name": "Updated Agent Name",
208
+ "description": "Updated description",
209
+ "framework": "langchain",
210
+ }
211
+ }
212
+
213
+
214
+ class Agent(BaseModel):
215
+ """Complete agent model for responses."""
216
+
217
+ id: str = Field(..., description="Unique agent identifier")
218
+ name: str = Field(..., description="Agent name")
219
+ description: str | None = Field(None, description="Agent description")
220
+ framework: AgentFramework = Field(..., description="Agent framework")
221
+ status: AgentStatus = Field(AgentStatus.DRAFT, description="Agent status")
222
+ created_at: datetime = Field(..., description="Creation timestamp")
223
+ updated_at: datetime = Field(..., description="Last update timestamp")
224
+
225
+ class Config:
226
+ json_schema_extra = {
227
+ "example": {
228
+ "id": "550e8400-e29b-41d4-a716-446655440000",
229
+ "name": "My AI Assistant",
230
+ "description": "A helpful AI assistant",
231
+ "framework": "langgraph",
232
+ "status": "draft",
233
+ "created_at": "2024-01-01T00:00:00",
234
+ "updated_at": "2024-01-01T00:00:00",
235
+ }
236
+ }
237
+
238
+
239
+ class AgentReplace(BaseModel):
240
+ """Full replacement schema for PUT of an agent.
241
+
242
+ Represents the complete updatable representation of an agent.
243
+ Server-managed fields like id, status, and timestamps are excluded.
244
+ """
245
+
246
+ name: str = Field(..., min_length=1, max_length=100, description="Agent name")
247
+ description: str | None = Field(
248
+ None, max_length=500, description="Agent description"
249
+ )
250
+ config: AgentConfig = Field(
251
+ ..., description="Framework-specific agent configuration"
252
+ )
253
+
254
+ @field_validator("name") # noqa: N805
255
+ @classmethod
256
+ def validate_name(cls, v):
257
+ if not v.strip():
258
+ raise ValueError("Name cannot be empty or whitespace only")
259
+ return v.strip()
260
+
261
+
262
+ class AgentPatch(BaseModel):
263
+ """Partial update schema for PATCH of an agent.
264
+
265
+ Only provided fields will be updated. If config is provided, the
266
+ framework will be inferred from config.type.
267
+ """
268
+
269
+ name: str | None = Field(
270
+ None, min_length=1, max_length=100, description="Agent name"
271
+ )
272
+ description: str | None = Field(
273
+ None, max_length=500, description="Agent description"
274
+ )
275
+ config: AgentConfig | None = Field(
276
+ None, description="Framework-specific agent configuration"
277
+ )
278
+
279
+ @field_validator("name") # noqa: N805
280
+ @classmethod
281
+ def validate_name(cls, v):
282
+ if v is not None and not v.strip():
283
+ raise ValueError("Name cannot be empty or whitespace only")
284
+ return v.strip() if v else v
285
+
286
+
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: idun-agent-schema
3
- Version: 0.1.41
3
+ Version: 0.2.0
4
4
  Summary: Centralized Pydantic schema library for Idun Agent Engine and Manager
5
5
  Project-URL: Homepage, https://github.com/geoffreyharrazi/idun-agent-platform
6
6
  Project-URL: Repository, https://github.com/geoffreyharrazi/idun-agent-platform
@@ -1,14 +1,14 @@
1
1
  idun_agent_schema/__init__.py,sha256=eRy0qwee7_nRSubm2X6jUnZyf55Dn9qztWtDocgIIJg,345
2
2
  idun_agent_schema/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- idun_agent_schema/engine/__init__.py,sha256=48Ow-dWqLI0DlJnZhCrs0z3X1AVxlHk4O0y0K9XJ57s,420
3
+ idun_agent_schema/engine/__init__.py,sha256=pLcOjL793n7E5Nf63L5NubA9Flfi8mcKoDzZ2DCKav8,394
4
4
  idun_agent_schema/engine/agent.py,sha256=KNzNMJcqjlczQL23Uqdkpcf2-b37p8vHkI5EZIdTHmE,569
5
5
  idun_agent_schema/engine/api.py,sha256=sN1QGQAuUb4znhR8QJ434sKblEJbDoXQfC4K7L9yyPQ,626
6
- idun_agent_schema/engine/config.py,sha256=bhROHb4rms97F2Ge8rRNaC7R-75LklSo2PIj787Y-Nc,790
7
- idun_agent_schema/engine/haystack.py,sha256=knpJTW4Er2JxRfuqGgDEjcxfHzaQrNXgLfLvsXeXo_s,332
6
+ idun_agent_schema/engine/config.py,sha256=XAwvz-c2Vilae8_uX86RcBNvP5pbut-cpYoQhGpu8d8,882
7
+ idun_agent_schema/engine/haystack.py,sha256=EtOYnsWRufcrQufTRMeB3V-rZVQqfnmwKwPsYGfZdCs,362
8
8
  idun_agent_schema/engine/langgraph.py,sha256=m6_xvMaCgkO1O3pf2M6NaBz3ASkjn8XGFeEcXvIr4sQ,1276
9
9
  idun_agent_schema/engine/server.py,sha256=uEuTi2ow2WOzCW4okqZmgwqEBtekgeA928Yq_gc48jU,338
10
- idun_agent_schema/manager/__init__.py,sha256=cGm8vg2CjGYsAyG4mM73JfWfg16u61YSGvcQVnp-XMA,1083
11
- idun_agent_schema/manager/api.py,sha256=wSGhkm_jkLwTiiPTMCambiBrKqR0AqlRVRkbfcmCnP8,3879
10
+ idun_agent_schema/manager/__init__.py,sha256=XwkaFY1EtMSuD3A0titNvFX5ZM2Hdyu8Ms4JSGUQhag,1114
11
+ idun_agent_schema/manager/api.py,sha256=mieoHzwOjqCRpDyRj7fuFX0rS0hp5-zjbKiFZdrIa6k,8078
12
12
  idun_agent_schema/manager/deployments.py,sha256=qpS0cTm6H8eWAfFFJ3w3jXBFVVal8dfVB79yBnLq9ow,213
13
13
  idun_agent_schema/manager/deps.py,sha256=Z3Kgq0CkCSmeInjROVebOrok3LsMzcs0LO8KyxiCsrM,315
14
14
  idun_agent_schema/manager/domain.py,sha256=MDXsFEN_jiCAMr1J3vAoZD_I1tIq6WZjJwvHcin0yvs,8840
@@ -17,6 +17,6 @@ idun_agent_schema/manager/errors.py,sha256=wPb6DHMd7mU9MnGBZw6U51JxJfKxuVKEHSbS1
17
17
  idun_agent_schema/manager/settings.py,sha256=Z3j18AayZxjhVy2JwbqKOgVA-GGBiGUsUj6Q0e9jCN0,5791
18
18
  idun_agent_schema/shared/__init__.py,sha256=C0g2hEWT5EwYdLya7oHmXdMTFOGHVINIxeFV2j2MpXw,151
19
19
  idun_agent_schema/shared/observability.py,sha256=EL0h0qSJ7gByMCASYkQRlPv5szffJ6aYY6699TZ6uRM,1741
20
- idun_agent_schema-0.1.41.dist-info/METADATA,sha256=k6PUhqp9HN_YfVDly-LEVde4zMvJTGQb9fmr8EZI0QI,1332
21
- idun_agent_schema-0.1.41.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
- idun_agent_schema-0.1.41.dist-info/RECORD,,
20
+ idun_agent_schema-0.2.0.dist-info/METADATA,sha256=Aljj6pUqkX1ix-O16GTRRz6XNzB8DWz579Ok8pKseJ0,1331
21
+ idun_agent_schema-0.2.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
22
+ idun_agent_schema-0.2.0.dist-info/RECORD,,