Skip to content

Commit 25e5ec1

Browse files
committed
Fix pydantic schema
1 parent 9c7edc3 commit 25e5ec1

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

financial-analyst-deepseek/README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ ollama pull deepseek-r1
2626

2727
You can use uv to directly install the required dependencies (recommended).
2828
```bash
29-
uv pip sync uv.lock
29+
uv sync
3030
```
3131

32-
Or you can also use pip to install the following dependecnies to your local environment.
32+
Or you can also use pip to install the following dependencies to your local environment.
3333
```bash
3434
pip install crewai crewai-tools ollama mcp pydantic yfinance pandas matplotlib
3535
```
@@ -53,8 +53,6 @@ In the JSON file, add this:
5353
"--directory",
5454
"absolute/path/to/project_root",
5555
"run",
56-
"--with",
57-
"mcp",
5856
"server.py"
5957
]
6058
}

financial-analyst-deepseek/finance_crew.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class QueryAnalysisOutput(BaseModel):
1010
"""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']).")
1212
timeframe: str = Field(..., description="Time period (e.g., '1d', '1mo', '1y').")
1313
action: str = Field(..., description="Action to be performed (e.g., 'fetch', 'plot').")
1414

@@ -60,17 +60,18 @@ class QueryAnalysisOutput(BaseModel):
6060

6161
code_execution_agent = Agent(
6262
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.",
6464
backstory="You are a code execution expert. You are skilled at executing Python code.",
6565
# tools=[code_interpreter_tool],
6666
allow_code_execution=True, # This automatically adds the CodeInterpreterTool
67+
allow_delegation=True,
6768
llm=llm,
6869
verbose=True,
6970
)
7071

7172
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.",
7475
agent=code_execution_agent,
7576
)
7677

0 commit comments

Comments
 (0)