Using Crypto.com AI Agent with Gemini

A guide to using the Crypto.com AI Agent with Google's Gemini model for blockchain interactions.

Quick Start

1. Setup

Start by cloning the repository and navigating to the appropriate directory, and install the dependencies:

# Clone the repository
git clone [email protected]:crypto-com/developer-platform-sdk-examples.git
cd developer-platform-sdk-examples/ai/cryptocom-ai-agent-pychatbot

# Install dependencies
pip install -r requirements.txt

2. Configure API Keys

Direct to Envand set up the following API keys in your environment:

  • OPENAI_API_KEY - For OpenAI functionality

  • GOOGLE_API_KEY - For Gemini functionality

  • GOOGLE_PROJECT_ID - For Gemini functionality

3. Launch the Chat

python chat.py

When prompted, select gemini as your AI provider.

API Examples

Query Latest Block using Gemini

curl -X POST http://localhost:8000/api/v1/cdc-ai-agent-service/query \
-H "Content-Type: application/json" \
-d '{
  "query": "get latest block",
  "options": {
    "gemini": {
      "apiKey": "YOUR_GOOGLE_API_KEY"
    },
    "llmProvider": "gemini",    
    "context": []
  }
}'

Query Latest Block using OpenAI

curl -X POST http://localhost:8000/api/v1/cdc-ai-agent-service/query \
-H "Content-Type: application/json" \
-d '{
  "query": "get latest block",
  "options": {
    "openAI": {
      "apiKey": "YOUR_OPENAI_API_KEY"
    },
    "llmProvider": "openai",
    "context": []
  }
}'

Last updated

Was this helpful?