|
1 | 1 | import asyncio |
2 | 2 | from typing import Any |
3 | 3 |
|
| 4 | +from pydantic import BaseModel, Field |
4 | 5 | from pydantic_ai import Agent, RunContext |
5 | | -from pydantic import BaseModel, Field |
6 | | -from typing import Optional, List, Dict, Any |
7 | 6 |
|
8 | 7 |
|
9 | 8 | class AgentSpecification(BaseModel): |
10 | | - name: Optional[str] = Field(None, description="Name of the LLM/agent") |
11 | | - version: Optional[str] = Field(None, description="Version of the LLM/agent") |
12 | | - description: Optional[str] = Field(None, description="Description of the LLM/agent") |
13 | | - capabilities: Optional[List[str]] = Field(None, description="List of capabilities") |
14 | | - configuration: Optional[Dict[str, Any]] = Field(None, description="Configuration settings") |
| 9 | + name: str | None = Field(None, description="Name of the LLM/agent") |
| 10 | + version: str | None = Field(None, description="Version of the LLM/agent") |
| 11 | + description: str | None = Field(None, description="Description of the LLM/agent") |
| 12 | + capabilities: list[str] | None = Field(None, description="List of capabilities") |
| 13 | + configuration: dict[str, Any] | None = Field( |
| 14 | + None, description="Configuration settings" |
| 15 | + ) |
| 16 | + |
15 | 17 |
|
16 | 18 | # Define the OperatorToolBox class |
17 | 19 | class OperatorToolBox: |
@@ -66,16 +68,14 @@ def run_operation(self, operation: str) -> str: |
66 | 68 | version="4.0", |
67 | 69 | description="A powerful language model", |
68 | 70 | capabilities=["text-generation", "question-answering"], |
69 | | - configuration={"max_tokens": 100} |
| 71 | + configuration={"max_tokens": 100}, |
70 | 72 | ) |
71 | 73 |
|
72 | 74 | # dataset_manager_agent.py |
73 | 75 |
|
74 | 76 |
|
75 | 77 | # Initialize OperatorToolBox |
76 | | -toolbox = OperatorToolBox( |
77 | | - spec=spec, datasets=["dataset1", "dataset2", "dataset3"] |
78 | | -) |
| 78 | +toolbox = OperatorToolBox(spec=spec, datasets=["dataset1", "dataset2", "dataset3"]) |
79 | 79 |
|
80 | 80 | # Define the agent with OperatorToolBox as its dependency |
81 | 81 | dataset_manager_agent = Agent( |
|
0 commit comments