# Using Crypto.com AI Agent with Gemini

### Quick Start

#### 1. Setup

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

```bash
# Clone the repository
git clone git@github.com:crypto-com/developer-platform-sdk-examples.git
cd developer-platform-sdk-examples/ai/cryptocom-ai-agent-pychatbot

# Install dependencies
pip install -r requirements.txt
```

<figure><img src="/files/KTogdeiUtv7lARaBPcN6" alt=""><figcaption></figcaption></figure>

#### 2. Configure API Keys

Direct to `Env`and 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&#x20;

#### 3. Launch the Chat

```bash
python chat.py
```

<figure><img src="/files/fi1p0KieM9zNu1nL5Wqf" alt=""><figcaption></figcaption></figure>

When prompted, select `gemini` as your AI provider. <br>

### API Examples

#### Query Latest Block using Gemini

```bash
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

```bash
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": []
  }
}'
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://ai-agent-sdk-docs.crypto.com/outdated-contents/using-crypto.com-ai-agent-with-gemini.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
