idun-agent-schema 0.1.41__py3-none-any.whl → 0.1.42__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 +1 -5
- 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.41.dist-info → idun_agent_schema-0.1.42.dist-info}/METADATA +1 -1
- idun_agent_schema-0.1.42.dist-info/RECORD +22 -0
- idun_agent_schema-0.1.41.dist-info/RECORD +0 -22
- {idun_agent_schema-0.1.41.dist-info → idun_agent_schema-0.1.42.dist-info}/WHEEL +0 -0
idun_agent_schema/__init__.py
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"""Idun Agent Schema - Centralized Pydantic schemas.
|
|
2
|
-
|
|
3
|
-
Public namespaces:
|
|
4
|
-
- idun_agent_schema.engine: Engine-related schemas
|
|
5
|
-
- idun_agent_schema.manager: Manager-related schemas
|
|
6
|
-
- idun_agent_schema.shared: Shared cross-cutting schemas
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
# Re-export key types for convenience
|
|
10
|
-
from .shared.observability import ObservabilityConfig # noqa: F401
|
|
1
|
+
"""Idun Agent Schema - Centralized Pydantic schemas.
|
|
2
|
+
|
|
3
|
+
Public namespaces:
|
|
4
|
+
- idun_agent_schema.engine: Engine-related schemas
|
|
5
|
+
- idun_agent_schema.manager: Manager-related schemas
|
|
6
|
+
- idun_agent_schema.shared: Shared cross-cutting schemas
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
# Re-export key types for convenience
|
|
10
|
+
from .shared.observability import ObservabilityConfig # noqa: F401
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
"""Engine-related schemas."""
|
|
2
|
-
|
|
3
|
-
from .agent import BaseAgentConfig # noqa: F401
|
|
4
|
-
from .api import ChatRequest, ChatResponse # noqa: F401
|
|
5
|
-
from .config import AgentConfig, EngineConfig # noqa: F401
|
|
6
|
-
from .
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
from .server import ServerAPIConfig, ServerConfig # noqa: F401
|
|
1
|
+
"""Engine-related schemas."""
|
|
2
|
+
|
|
3
|
+
from .agent import BaseAgentConfig # noqa: F401
|
|
4
|
+
from .api import ChatRequest, ChatResponse # noqa: F401
|
|
5
|
+
from .config import AgentConfig, EngineConfig # noqa: F401
|
|
6
|
+
from .langgraph import ( # noqa: F401
|
|
7
|
+
CheckpointConfig,
|
|
8
|
+
LangGraphAgentConfig,
|
|
9
|
+
SqliteCheckpointConfig,
|
|
10
|
+
)
|
|
11
|
+
from .server import ServerAPIConfig, ServerConfig # noqa: F401
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
"""Common agent model definitions (engine)."""
|
|
2
|
-
|
|
3
|
-
from typing import Any
|
|
4
|
-
|
|
5
|
-
from pydantic import BaseModel, Field
|
|
6
|
-
|
|
7
|
-
from idun_agent_schema.shared import ObservabilityConfig
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
class BaseAgentConfig(BaseModel):
|
|
11
|
-
"""Base model for agent configurations. Extend for specific frameworks."""
|
|
12
|
-
|
|
13
|
-
name: str | None = Field(default="Unnamed Agent")
|
|
14
|
-
input_schema_definition: dict[str, Any] | None = Field(default_factory=dict)
|
|
15
|
-
output_schema_definition: dict[str, Any] | None = Field(default_factory=dict)
|
|
16
|
-
observability: ObservabilityConfig | None = Field(default=None)
|
|
1
|
+
"""Common agent model definitions (engine)."""
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
from idun_agent_schema.shared import ObservabilityConfig
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class BaseAgentConfig(BaseModel):
|
|
11
|
+
"""Base model for agent configurations. Extend for specific frameworks."""
|
|
12
|
+
|
|
13
|
+
name: str | None = Field(default="Unnamed Agent")
|
|
14
|
+
input_schema_definition: dict[str, Any] | None = Field(default_factory=dict)
|
|
15
|
+
output_schema_definition: dict[str, Any] | None = Field(default_factory=dict)
|
|
16
|
+
observability: ObservabilityConfig | None = Field(default=None)
|
idun_agent_schema/engine/api.py
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
"""Schemas for engine HTTP API request/response payloads."""
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ChatRequest(BaseModel):
|
|
7
|
-
"""Request payload for synchronous and streaming chat endpoints.
|
|
8
|
-
|
|
9
|
-
Attributes:
|
|
10
|
-
session_id: Client-provided session identifier for routing state.
|
|
11
|
-
query: Natural language prompt or input for the agent.
|
|
12
|
-
|
|
13
|
-
"""
|
|
14
|
-
|
|
15
|
-
session_id: str
|
|
16
|
-
query: str
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
class ChatResponse(BaseModel):
|
|
20
|
-
"""Response payload for chat endpoints.
|
|
21
|
-
|
|
22
|
-
Attributes:
|
|
23
|
-
session_id: Echoed session identifier.
|
|
24
|
-
response: Agent's textual response.
|
|
25
|
-
|
|
26
|
-
"""
|
|
27
|
-
|
|
28
|
-
session_id: str
|
|
29
|
-
response: str
|
|
1
|
+
"""Schemas for engine HTTP API request/response payloads."""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ChatRequest(BaseModel):
|
|
7
|
+
"""Request payload for synchronous and streaming chat endpoints.
|
|
8
|
+
|
|
9
|
+
Attributes:
|
|
10
|
+
session_id: Client-provided session identifier for routing state.
|
|
11
|
+
query: Natural language prompt or input for the agent.
|
|
12
|
+
|
|
13
|
+
"""
|
|
14
|
+
|
|
15
|
+
session_id: str
|
|
16
|
+
query: str
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class ChatResponse(BaseModel):
|
|
20
|
+
"""Response payload for chat endpoints.
|
|
21
|
+
|
|
22
|
+
Attributes:
|
|
23
|
+
session_id: Echoed session identifier.
|
|
24
|
+
response: Agent's textual response.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
session_id: str
|
|
29
|
+
response: str
|
|
@@ -15,11 +15,7 @@ class AgentConfig(BaseModel):
|
|
|
15
15
|
"""Configuration for agent specification and settings."""
|
|
16
16
|
|
|
17
17
|
type: Literal["langgraph", "ADK", "CREWAI", "haystack"] = Field(default="langgraph")
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
config: BaseAgentConfig | HaystackAgentConfig | LangGraphAgentConfig = Field(
|
|
21
|
-
default_factory=BaseAgentConfig
|
|
22
|
-
)
|
|
18
|
+
config: BaseAgentConfig | HaystackAgentConfig | LangGraphAgentConfig
|
|
23
19
|
|
|
24
20
|
|
|
25
21
|
class EngineConfig(BaseModel):
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
"""Configuration models for Haystack agents."""
|
|
2
|
-
|
|
3
|
-
from typing import Literal
|
|
4
|
-
|
|
5
|
-
from .
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class HaystackAgentConfig(BaseAgentConfig):
|
|
9
|
-
"""Configuration model for Haystack Agents."""
|
|
10
|
-
|
|
11
|
-
type: Literal["haystack"] = "haystack"
|
|
12
|
-
component_type: Literal["pipeline", "agent"]
|
|
13
|
-
component_definition: str
|
|
1
|
+
"""Configuration models for Haystack agents."""
|
|
2
|
+
|
|
3
|
+
from typing import Literal
|
|
4
|
+
|
|
5
|
+
from idun_agent_engine.core.engine_config import BaseAgentConfig
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class HaystackAgentConfig(BaseAgentConfig):
|
|
9
|
+
"""Configuration model for Haystack Agents."""
|
|
10
|
+
|
|
11
|
+
type: Literal["haystack"] = "haystack"
|
|
12
|
+
component_type: Literal["pipeline", "agent"]
|
|
13
|
+
component_definition: str
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
"""Configuration models for LangGraph agents (engine)."""
|
|
2
|
-
|
|
3
|
-
from typing import Any, Literal
|
|
4
|
-
from urllib.parse import urlparse
|
|
5
|
-
|
|
6
|
-
from pydantic import BaseModel, field_validator
|
|
7
|
-
|
|
8
|
-
from .agent import BaseAgentConfig
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class SqliteCheckpointConfig(BaseModel):
|
|
12
|
-
"""Configuration for SQLite checkpointer."""
|
|
13
|
-
|
|
14
|
-
type: Literal["sqlite"]
|
|
15
|
-
db_url: str
|
|
16
|
-
|
|
17
|
-
@field_validator("db_url")
|
|
18
|
-
@classmethod
|
|
19
|
-
def db_url_must_be_sqlite(cls, v: str) -> str:
|
|
20
|
-
"""Ensure the provided database URL uses the sqlite scheme.
|
|
21
|
-
|
|
22
|
-
Raises:
|
|
23
|
-
ValueError: If the URL does not start with 'sqlite:///'.
|
|
24
|
-
|
|
25
|
-
"""
|
|
26
|
-
if not v.startswith("sqlite:///"):
|
|
27
|
-
raise ValueError("SQLite DB URL must start with 'sqlite:///'")
|
|
28
|
-
return v
|
|
29
|
-
|
|
30
|
-
@property
|
|
31
|
-
def db_path(self) -> str:
|
|
32
|
-
"""Return filesystem path component derived from the sqlite URL."""
|
|
33
|
-
path = urlparse(self.db_url).path
|
|
34
|
-
if self.db_url.startswith("sqlite:///"):
|
|
35
|
-
return path.lstrip("/")
|
|
36
|
-
return path
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
CheckpointConfig = SqliteCheckpointConfig
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
class LangGraphAgentConfig(BaseAgentConfig):
|
|
43
|
-
"""Configuration model for LangGraph agents."""
|
|
44
|
-
|
|
45
|
-
graph_definition: str
|
|
46
|
-
checkpointer: CheckpointConfig | None = None
|
|
47
|
-
store: dict[str, Any] | None = None
|
|
1
|
+
"""Configuration models for LangGraph agents (engine)."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Literal
|
|
4
|
+
from urllib.parse import urlparse
|
|
5
|
+
|
|
6
|
+
from pydantic import BaseModel, field_validator
|
|
7
|
+
|
|
8
|
+
from .agent import BaseAgentConfig
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class SqliteCheckpointConfig(BaseModel):
|
|
12
|
+
"""Configuration for SQLite checkpointer."""
|
|
13
|
+
|
|
14
|
+
type: Literal["sqlite"]
|
|
15
|
+
db_url: str
|
|
16
|
+
|
|
17
|
+
@field_validator("db_url")
|
|
18
|
+
@classmethod
|
|
19
|
+
def db_url_must_be_sqlite(cls, v: str) -> str:
|
|
20
|
+
"""Ensure the provided database URL uses the sqlite scheme.
|
|
21
|
+
|
|
22
|
+
Raises:
|
|
23
|
+
ValueError: If the URL does not start with 'sqlite:///'.
|
|
24
|
+
|
|
25
|
+
"""
|
|
26
|
+
if not v.startswith("sqlite:///"):
|
|
27
|
+
raise ValueError("SQLite DB URL must start with 'sqlite:///'")
|
|
28
|
+
return v
|
|
29
|
+
|
|
30
|
+
@property
|
|
31
|
+
def db_path(self) -> str:
|
|
32
|
+
"""Return filesystem path component derived from the sqlite URL."""
|
|
33
|
+
path = urlparse(self.db_url).path
|
|
34
|
+
if self.db_url.startswith("sqlite:///"):
|
|
35
|
+
return path.lstrip("/")
|
|
36
|
+
return path
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
CheckpointConfig = SqliteCheckpointConfig
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class LangGraphAgentConfig(BaseAgentConfig):
|
|
43
|
+
"""Configuration model for LangGraph agents."""
|
|
44
|
+
|
|
45
|
+
graph_definition: str
|
|
46
|
+
checkpointer: CheckpointConfig | None = None
|
|
47
|
+
store: dict[str, Any] | None = None
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"""Server configuration models (engine)."""
|
|
2
|
-
|
|
3
|
-
from pydantic import BaseModel, Field
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ServerAPIConfig(BaseModel):
|
|
7
|
-
"""API server configuration."""
|
|
8
|
-
|
|
9
|
-
port: int = 8000
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
class ServerConfig(BaseModel):
|
|
13
|
-
"""Configuration for the Engine's universal settings."""
|
|
14
|
-
|
|
15
|
-
api: ServerAPIConfig = Field(default_factory=ServerAPIConfig)
|
|
1
|
+
"""Server configuration models (engine)."""
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel, Field
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class ServerAPIConfig(BaseModel):
|
|
7
|
+
"""API server configuration."""
|
|
8
|
+
|
|
9
|
+
port: int = 8000
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class ServerConfig(BaseModel):
|
|
13
|
+
"""Configuration for the Engine's universal settings."""
|
|
14
|
+
|
|
15
|
+
api: ServerAPIConfig = Field(default_factory=ServerAPIConfig)
|
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
"""Manager-related schemas."""
|
|
2
|
-
|
|
3
|
-
from .api import ( # noqa: F401
|
|
4
|
-
AgentCreateRequest,
|
|
5
|
-
AgentResponse,
|
|
6
|
-
AgentRunRequest,
|
|
7
|
-
AgentRunResponse,
|
|
8
|
-
AgentRunSummaryResponse,
|
|
9
|
-
AgentStatsResponse,
|
|
10
|
-
AgentSummaryResponse,
|
|
11
|
-
AgentUpdateRequest,
|
|
12
|
-
PaginatedAgentsResponse,
|
|
13
|
-
PaginatedResponse,
|
|
14
|
-
PaginatedRunsResponse,
|
|
15
|
-
)
|
|
16
|
-
from .deps import Principal # noqa: F401
|
|
17
|
-
from .domain import ( # noqa: F401
|
|
18
|
-
AgentEntity,
|
|
19
|
-
AgentFramework,
|
|
20
|
-
AgentRunEntity,
|
|
21
|
-
AgentStatus,
|
|
22
|
-
TenantEntity,
|
|
23
|
-
TenantPlan,
|
|
24
|
-
TenantStatus,
|
|
25
|
-
TenantUserEntity,
|
|
26
|
-
)
|
|
27
|
-
from .dto import ( # noqa: F401
|
|
28
|
-
AgentCreateDTO,
|
|
29
|
-
AgentDeploymentDTO,
|
|
30
|
-
AgentHealthDTO,
|
|
31
|
-
AgentMetricsDTO,
|
|
32
|
-
AgentRunCreateDTO,
|
|
33
|
-
AgentUpdateDTO,
|
|
34
|
-
TenantCreateDTO,
|
|
35
|
-
TenantQuotaDTO,
|
|
36
|
-
TenantUpdateDTO,
|
|
37
|
-
TenantUsageDTO,
|
|
38
|
-
TenantUserCreateDTO,
|
|
39
|
-
TenantUserUpdateDTO,
|
|
40
|
-
)
|
|
41
|
-
from .errors import ProblemDetail # noqa: F401
|
|
42
|
-
from .settings import ( # noqa: F401
|
|
43
|
-
APISettings,
|
|
44
|
-
AuthSettings,
|
|
45
|
-
CelerySettings,
|
|
46
|
-
DatabaseSettings,
|
|
47
|
-
ObservabilitySettings,
|
|
48
|
-
RedisSettings,
|
|
49
|
-
Settings,
|
|
50
|
-
)
|
|
1
|
+
"""Manager-related schemas."""
|
|
2
|
+
|
|
3
|
+
from .api import ( # noqa: F401
|
|
4
|
+
AgentCreateRequest,
|
|
5
|
+
AgentResponse,
|
|
6
|
+
AgentRunRequest,
|
|
7
|
+
AgentRunResponse,
|
|
8
|
+
AgentRunSummaryResponse,
|
|
9
|
+
AgentStatsResponse,
|
|
10
|
+
AgentSummaryResponse,
|
|
11
|
+
AgentUpdateRequest,
|
|
12
|
+
PaginatedAgentsResponse,
|
|
13
|
+
PaginatedResponse,
|
|
14
|
+
PaginatedRunsResponse,
|
|
15
|
+
)
|
|
16
|
+
from .deps import Principal # noqa: F401
|
|
17
|
+
from .domain import ( # noqa: F401
|
|
18
|
+
AgentEntity,
|
|
19
|
+
AgentFramework,
|
|
20
|
+
AgentRunEntity,
|
|
21
|
+
AgentStatus,
|
|
22
|
+
TenantEntity,
|
|
23
|
+
TenantPlan,
|
|
24
|
+
TenantStatus,
|
|
25
|
+
TenantUserEntity,
|
|
26
|
+
)
|
|
27
|
+
from .dto import ( # noqa: F401
|
|
28
|
+
AgentCreateDTO,
|
|
29
|
+
AgentDeploymentDTO,
|
|
30
|
+
AgentHealthDTO,
|
|
31
|
+
AgentMetricsDTO,
|
|
32
|
+
AgentRunCreateDTO,
|
|
33
|
+
AgentUpdateDTO,
|
|
34
|
+
TenantCreateDTO,
|
|
35
|
+
TenantQuotaDTO,
|
|
36
|
+
TenantUpdateDTO,
|
|
37
|
+
TenantUsageDTO,
|
|
38
|
+
TenantUserCreateDTO,
|
|
39
|
+
TenantUserUpdateDTO,
|
|
40
|
+
)
|
|
41
|
+
from .errors import ProblemDetail # noqa: F401
|
|
42
|
+
from .settings import ( # noqa: F401
|
|
43
|
+
APISettings,
|
|
44
|
+
AuthSettings,
|
|
45
|
+
CelerySettings,
|
|
46
|
+
DatabaseSettings,
|
|
47
|
+
ObservabilitySettings,
|
|
48
|
+
RedisSettings,
|
|
49
|
+
Settings,
|
|
50
|
+
)
|