# Example - AI PDF Analyser

With Dualite, you can integrate state-of-the-art AI models like Gemini, OpenAI and Claude in whatever you've been building with us.&#x20;

<figure><img src="/files/YVvhKRcxPho2dz3Fxi0R" alt=""><figcaption><p>How Dualite builders feel building AI builder tools using an AI tool</p></figcaption></figure>

## Building a simple AI PDF analyser tool with Dualite

{% hint style="info" %}
The below approach essentially stores your AI model's API key in the frontend, which may not be ideal at certain situations. We're working on a better way to deal with this.
{% endhint %}

### 1. Prompt

We're using Dualite and starting out with the following prompt:

> *Build me an AI PDF analyser tool "PDFAnalyse" in which users can upload any kind of PDF, and the tool analyses and gives a strong summary of the uploaded PDF*<br>
>
> *Have an upload functionality where user can upload the PDF. When we submit this form, it should make an AI call to Gemini (use the model name - gemini-2.5-flash-preview-05-20). Pass the PDF files directly to Gemini.*<br>
>
> *The final result should be a summarised version of the PDF*

{% hint style="info" %}
Make sure you type in the model name (in this case, gemini-2.5-flash-preview-05-20). Also in certain cases dealing with PDFs and documents, clearly add another prompt to directly pass the PDF to Gemini since it can sometime start parsing which can cause unnecessary additional iterations
{% endhint %}

<figure><img src="/files/WwLGTmeX6autJfxyE8j6" alt=""><figcaption><p>Choosing React + Tailwind</p></figcaption></figure>

### 2. Copy-paste your AI API Key into Dualite

Now you simply need to integrate your API Key. In the above case, we're just gonna head to [Google AI Studio](https://aistudio.google.com/) and get our API Key and paste it in the env file (your\_gemini\_api\_key\_here) in the "Code" section. For security purposes can't show you the API key.

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

### 3. And...you're done!

{% hint style="info" %}
There can be situations where you'll need to re-run the terminal after putting the Gemini API key. make sure you go to Dualite Terminal below do Ctrl + C (on Mac) to kill the server and redo *yarn* and then *yarn run dev* step-by-step
{% endhint %}

<figure><img src="/files/7sBeG5ecTH5tRXMgeCqy" alt=""><figcaption></figcaption></figure>

While there are countless AI tools available online, Dualite stands out with its superior focus on security. Unlike many platforms that expose API keys publicly, Dualite securely stores them in a .env file, ensuring your credentials remain protected.


---

# 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://alphadocs.dualite.dev/build-ai-apps-with-dualite/example-ai-pdf-analyser.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.
