|
8 | 8 |
|
9 | 9 | class QueryAnalysisOutput(BaseModel): |
10 | 10 | """Structured output for the query analysis task.""" |
11 | | - symbol: str = Field(..., description="Stock ticker symbol (e.g., TSLA, AAPL).") |
| 11 | + symbols: list[str] = Field(..., description="List of stock ticker symbols (e.g., ['TSLA', 'AAPL']).") |
12 | 12 | timeframe: str = Field(..., description="Time period (e.g., '1d', '1mo', '1y').") |
13 | 13 | action: str = Field(..., description="Action to be performed (e.g., 'fetch', 'plot').") |
14 | 14 |
|
@@ -60,17 +60,18 @@ class QueryAnalysisOutput(BaseModel): |
60 | 60 |
|
61 | 61 | code_execution_agent = Agent( |
62 | 62 | role="Senior Code Execution Expert", |
63 | | - goal="Review and execute the generated Python code by code writer agent to visualize stock data.", |
| 63 | + goal="Review and execute the generated Python code by code writer agent to visualize stock data and fix any errors encountered. It can delegate tasks to code writer agent if needed.", |
64 | 64 | backstory="You are a code execution expert. You are skilled at executing Python code.", |
65 | 65 | # tools=[code_interpreter_tool], |
66 | 66 | allow_code_execution=True, # This automatically adds the CodeInterpreterTool |
| 67 | + allow_delegation=True, |
67 | 68 | llm=llm, |
68 | 69 | verbose=True, |
69 | 70 | ) |
70 | 71 |
|
71 | 72 | code_execution_task = Task( |
72 | | - description="""Review and execute the generated Python code by code writer agent to visualize stock data.""", |
73 | | - expected_output="A clean and executable Python script file (.py) for stock visualization.", |
| 73 | + description="""Review and execute the generated Python code by code writer agent to visualize stock data and fix any errors encountered.""", |
| 74 | + expected_output="A clean, working and executable Python script file (.py) for stock visualization.", |
74 | 75 | agent=code_execution_agent, |
75 | 76 | ) |
76 | 77 |
|
|
0 commit comments