# Gemini

Google currently provides free API access to the **Gemini 1.5 Pro** model, one of the most powerful models available for free. This model offers code editing capabilities comparable to GPT-3.5, making it an excellent choice for use with PapertLab. To get started, you’ll need to obtain a Gemini API key.

**Adding API Keys via PapertLab Settings**

<figure><img src="https://323147515-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDxsCSiLtcLEhVsYJxaEU%2Fuploads%2FQ26BaaEAU9bzccvdzGxb%2Fapi.png?alt=media&#x26;token=860a196c-19d5-4b4d-b770-f273e8898459" alt=""><figcaption></figcaption></figure>

In addition to setting the API key via environment variables, you can also add your Gemini API key directly through PapertLab’s settings page for easier management:

1. **Open PapertLab and Go to Settings**: Start PapertLab and navigate to the settings page.
2. **Locate the API Section**: Find the section dedicated to API key management.
3. **Enter Your API Key**: Input your Gemini API key in the provided field.
4. **Save Your Changes**: After entering the key, save your settings. PapertLab will now use the Gemini models with the provided API key.

By following these steps, you can seamlessly integrate the Gemini 1.5 Pro model with PapertLab and take full advantage of its powerful code editing capabilities. Whether you prefer setting up via the command line or using the convenient settings page, PapertLab offers flexibility in how you connect and use Gemini’s AI models.

**Steps to Use Gemini 1.5 Pro with PapertLab**

1. **Install PapertLab**: First, ensure that PapertLab is installed on your system. If it’s not, you can install it easily using pip:

   ```bash
   python -m pip install papert-lab
   ```
2. **Set Your Gemini API Key**:
   * **Mac/Linux**:

     ```bash
     export GEMINI_API_KEY=<your-api-key>
     ```
   * **Windows**:

     ```cmd
     setx GEMINI_API_KEY <your-api-key>
     ```

     *(Note: After using `setx`, restart your shell for the changes to take effect.)*
3. **Using PapertLab with the Gemini 1.5 Pro Model**:
   * To utilize the **Gemini 1.5 Pro** model, specify it when running PapertLab:

     ```bash
     papertlab --model gemini/gemini-1.5-pro-latest
     ```
4. **Listing Available Gemini Models**: To explore other models offered by Gemini, list them with the following command:

   ```bash
   papertlab --models gemini/
   ```


---

# 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://docs.papert.in/connecting-to-llms/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.
