Types¶
Data models for agent and workflow configurations.
DaprAgentConfig¶
Configuration model for Dapr Agent creation.
DaprAgentConfig
¶
Bases: BaseModel
Configuration model for Dapr Agent creation.
Attributes¶
role
class-attribute
instance-attribute
¶
goal
class-attribute
instance-attribute
¶
instructions
class-attribute
instance-attribute
¶
system_prompt
class-attribute
instance-attribute
¶
tools
class-attribute
instance-attribute
¶
llm_config
class-attribute
instance-attribute
¶
llm_config: LlmProviderConfig | None = Field(
default=None, description="LLM provider configuration"
)
agent_type
class-attribute
instance-attribute
¶
WorkflowDefinition¶
Definition for a converted workflow.
WorkflowDefinition
¶
Bases: BaseModel
Definition for a converted workflow.
Attributes¶
description
class-attribute
instance-attribute
¶
tasks
class-attribute
instance-attribute
¶
edges
class-attribute
instance-attribute
¶
start_node
class-attribute
instance-attribute
¶
end_nodes
class-attribute
instance-attribute
¶
inputs
class-attribute
instance-attribute
¶
outputs
class-attribute
instance-attribute
¶
outputs: list[PropertySchema] = Field(
default_factory=list,
description="Workflow output schemas",
)
subflows
class-attribute
instance-attribute
¶
subflows: dict[str, WorkflowDefinition] = Field(
default_factory=dict,
description="Nested subflow definitions",
)
WorkflowTaskDefinition¶
Definition for a workflow task.
WorkflowTaskDefinition
¶
WorkflowEdgeDefinition¶
Definition for workflow edges (control and data flow).
WorkflowEdgeDefinition
¶
Bases: BaseModel
Definition for workflow edges (control and data flow).
Attributes¶
from_node
class-attribute
instance-attribute
¶
from_branch
class-attribute
instance-attribute
¶
condition
class-attribute
instance-attribute
¶
data_mapping
class-attribute
instance-attribute
¶
data_mapping: dict[str, str] = Field(
default_factory=dict,
description="Data mapping from source to target",
)
ToolDefinition¶
Definition for a converted tool.
ToolDefinition
¶
Bases: BaseModel
Definition for a converted tool.
LlmProviderConfig¶
Configuration for LLM provider.
LlmProviderConfig
¶
Bases: BaseModel
LLM provider configuration.
Enums¶
OASComponentType¶
OASComponentType
¶
Bases: str, Enum
Open Agent Spec component types.
DaprAgentType¶
DaprAgentType
¶
Bases: str, Enum
Dapr Agents agent types.
Usage Examples¶
Creating Configurations Programmatically¶
from dapr_agents_oas_adapter.types import (
DaprAgentConfig,
WorkflowDefinition,
WorkflowTaskDefinition,
WorkflowEdgeDefinition
)
# Create an agent config
agent = DaprAgentConfig(
name="research_agent",
role="Researcher",
goal="Find information",
instructions=["Search thoroughly", "Cite sources"],
tools=["web_search", "summarize"]
)
# Create a workflow
workflow = WorkflowDefinition(
name="analysis_pipeline",
tasks=[
WorkflowTaskDefinition(name="start", task_type="start"),
WorkflowTaskDefinition(
name="analyze",
task_type="llm",
config={"prompt_template": "Analyze: {{ input }}"}
),
WorkflowTaskDefinition(name="end", task_type="end")
],
edges=[
WorkflowEdgeDefinition(from_node="start", to_node="analyze"),
WorkflowEdgeDefinition(from_node="analyze", to_node="end")
],
start_node="start",
end_nodes=["end"]
)
Task Types¶
| Type | Description |
|---|---|
start |
Workflow entry point |
end |
Workflow exit point |
llm |
LLM call task |
tool |
Tool invocation |
agent |
Agent delegation |
flow |
Child workflow call |
map |
Parallel fan-out |