Skip to main content
The Agent class is optional. For simple use cases or when you need full control, use generate_text and stream_text directly.

Core Functions

ai-query provides two main functions: Both support tools, multiple providers, and conversation history.

Basic Usage

Streaming

With Tools

Conversation History

Manage history yourself with a list of messages.

Simple Chatbot Class

Build a minimal chatbot without Agent.

Multi-Provider

Switch providers easily.

With Stop Conditions

Control tool execution loops.

With Callbacks

Monitor execution with callbacks.

Embeddings

Generate embeddings without agents.

When to Use What

Full Example: CLI Chat

A complete command-line chatbot.