> For the complete documentation index, see [llms.txt](https://red-3.gitbook.io/litegpt/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://red-3.gitbook.io/litegpt/async/asynclitegpt/ask.md).

# ask

The `ask` function is designed for seamless interaction with the AI chat named Cloude using `Asynchronous`.

#### Properties:

* **`prompt`**: Your query or message sent to the AI.
* **`history`**: The conversation history, which must be an object of type `AsyncHistory`.

#### Example Usage:

{% tabs %}
{% tab title="First" %}

```python
from litegpt import AsyncLiteGPT
import asyncio

async def main():
    bot = AsyncLiteGPT(http2=True)
    print(await bot.ask("Your query text..."))
    
asyncio.run(main())
```

{% endtab %}

{% tab title="Second" %}

```python
from litegpt import AsyncLiteGPT
from litegpt.lib import AsyncHistory
import asyncio
# Creating a Asynchronous history object and adding messages
async def main():
    history = AsyncHistory()
    await history.insert([
        ("system", "system options here!"),
        ("assistant", "assistant first message!"),
        ("user", "user message here!"),
        ("assistant", "assistant second message!")
        ])

    # Initializing the LiteGPT object and sending a request
    bot = LiteGPT(http2=True)
    print(await bot.ask("Your query text...", history))
    
asyncio.run(main())
```

{% endtab %}
{% endtabs %}

Thus, the `ask` function provides a convenient and efficient way to send queries to the AI chat while maintaining the dialogue context.
