This project contains a simple ADK agent that fetches the current price of a given stock ticker symbol using the yfinance library.
To get this project up and running on your local machine, follow the instructions for your operating system.
Ensure you have Python 3.9+ installed. This project uses uv for dependency management. If you don't have uv installed, you can install it using pip:
pip install uvThis project uses Ollama to run the llama3.2:latest model. Please ensure you have Ollama installed and the model pulled:
-
Install Ollama: Follow the instructions on the Ollama website to install Ollama for your operating system.
-
Pull the Llama 3.2 model: Once Ollama is installed, open your terminal and run:
ollama pull llama3.2:latest
-
Clone the repository:
git clone <https://github.com/OSOSerious/Google-ADK-Agents.git> cd ADK_AI
-
Install dependencies:
uv pip install -r requirements.txt
After completing the general steps, you can run the ADK web server:
adk web --port 8001Access the web UI at http://localhost:8001.
After completing the general steps, you can run the ADK web server:
adk web --port 8001Access the web UI at http://localhost:8001.
Alternatively, you can run the ADK Stock Price Agent using Docker. Ensure you have Docker installed and running on your system.
-
Build the Docker Image:
Navigate to the root directory of this project (
ADK_AI) in your terminal and run:docker build -t adk-stock-agent . -
Run the Docker Container:
docker run -p 8001:8001 adk-stock-agent
Important Note on Ollama: The Docker container runs your ADK agent, but it does not run the Ollama server itself. You need to ensure your Ollama server (with the
llama3.2:latestmodel) is running and accessible from where your Docker container will be running. If Ollama is running on your host machine, you might need to configure LiteLLM in your agent (e.g., inapp/agent.pyor via an environment variable) to usehttp://host.docker.internal:11434(for Docker Desktop on macOS/Windows) or your host machine's actual IP address instead oflocalhostor127.0.0.1.Access the web UI at
http://localhost:8001.
app/agent.py: Contains the ADK agent definition and theget_stock_pricetool.requirements.txt: Lists the Python dependencies.README.md: This file.main.py,pyproject.toml,uv.lock: Other project files.
Once the ADK Web Server is running, you can interact with the agent through the web UI to get stock prices. Provide a ticker symbol when prompted.
This project now includes preliminary support for multi-chain crypto interactions through the ADK agent. The app/agent.py file has been updated with the following tools:
get_evm_balance(address: str, rpc_url: str): Fetches the ETH balance for a given EVM address. By default, it uses a public Ethereum Mainnet Infura RPC URL. Remember to replaceYOUR_INFURA_PROJECT_IDwith your actual Infura Project ID for full functionality.get_cosmos_balance_placeholder(address: str, chain_id: str, denom: str): A placeholder tool for Cosmos chain interactions. This currently returns a mock value. To enable real Cosmos chain queries, you will need to replace the placeholder logic with actual API calls to a Cosmos blockchain's RPC/REST endpoints.
For the EVM tool to function correctly, the web3 Python library is required. This has been added to requirements.txt. Ensure you have installed it by running:
uv pip install -r requirements.txtWhen interacting with the agent via the web UI, you can prompt it to use these new tools. For example:
- To get an ETH balance: "What is the ETH balance of 0x... (EVM address)?"
- To get a Cosmos balance (currently placeholder): "What is the ATOM balance of cosmos1... (Cosmos address) on cosmoshub-4?"