Installation
Quick Start
Features
- Multi-Provider: Switch between Google, OpenAI, and OpenRouter mid-conversation
- Tool Calling: Built-in tools the AI can use to answer questions
- Conversation Memory: Context persists across provider switches
- Slash Commands: Control the app without leaving the chat
Slash Commands
Model Switching
Switch providers or models at any time:provider- Uses provider’s default modelprovider:model- Specific modelprovider/model- Alternative notation
Filtering Models
Viewing History
The/messages command shows the full conversation including tool interactions:
Built-in Tools
The AI can autonomously use these tools to answer your questions:current-time
Get the current time.
Returns: ISO 8601 timestamp
current-date
Get the current date.
Returns: ISO 8601 timestamp
weather
Get weather information for a US zipcode.
Returns: JSON with current conditions, temperature, humidity, wind, UV index
Data source: wttr.in API
location-lookup
Get geographic data for any location query.
Returns: Array of location objects with coordinates, address details, place IDs
Data source: OpenStreetMap Nominatim API
surf-web
Fetch the content of a web page.
Returns: HTML content of the page
Multi-Step Tool Calling
Watch the AI chain tools together to solve complex questions:- Look up the Moda Center’s location to get a zipcode
- Use that zipcode to fetch the weather
- Synthesize the results into a natural response
Conversation Memory
Context persists across the entire session, including model switches:Environment Setup
Create a.env file in the chatarang directory or set environment variables:
Required Keys
You only need keys for the providers you plan to use.
Supported Providers
Google (Gemini)
Default provider. Models include:google:gemini-2.0-flash(default)google:gemini-1.5-progoogle:gemini-1.5-flash
OpenAI
GPT models:openai:gpt-4oopenai:gpt-4o-miniopenai:gpt-4
OpenRouter
Access to various models through OpenRouter:openrouter:anthropic/claude-3-opusopenrouter:meta-llama/llama-3-70b- And many more
Output Colors
Chatarang uses colors to distinguish message types:Sample Session
Adding Custom Tools
To add your own tools, editlib/tools.dart:
tools list in the same file.
