Make sure you have Ollama installed and running locally:
Copy
# Install Ollama from https://ollama.ai/# Pull the llama3.2 modelollama pull llama3.2
2
Create a file
Create a new file ollama_stock.py with the following code:
Copy
from praisonaiagents import Agent, MCPstock_agent = Agent( instructions="""You are a Stock Price Assistant.""", llm="ollama/llama3.2", tools=MCP("/Users/praison/miniconda3/envs/mcp/bin/python /Users/praison/stockprice/app.py"))# NOTE: Python Path replace with yours: /Users/praison/miniconda3/envs/mcp/bin/python# NOTE: app.py file path, replace it with yours: /Users/praison/stockprice/app.pystock_agent.start("What is the Stock Price of Apple?")
3
Install Dependencies
Make sure you have the required packages installed: