Configuration
Customize your perfect AI agent setup with Vizra ADK's flexible configuration system ๐๏ธ
Configuration Made Simple!
Think of configuration as painting your masterpiece! ๐๏ธ With Vizra ADK, you have all the colors (options) at your fingertips. Let's make your AI agents work exactly how you want them to!
๐ Your Configuration Hub
After installing Vizra ADK, your shiny new configuration file lives at:
config/vizra-adk.php
๐ก Pro tip: Haven't published it yet? No worries! Run this magic command:
php artisan vendor:publish --tag=vizra-adk-config
๐ค Choose Your AI Provider
๐ฏ Default Provider
Pick your favorite AI companion! Set it in your .env
file:
VIZRA_ADK_DEFAULT_PROVIDER=openai
โจ Available Providers
Choose from these amazing AI providers:
openai
- GPT models
anthropic
- Claude models
gemini
- Google's finest
๐ช Pick Your Model
Choose the AI model that powers your agents' brilliance:
VIZRA_ADK_DEFAULT_MODEL=gemini-pro
๐ข OpenAI Models
gpt-4-turbo
gpt-3.5-turbo
๐ฃ Anthropic Models
claude-3-opus-20240229
claude-3-sonnet-20240229
๐ต Google Models
gemini-pro
gemini-1.5-pro
๐ธ Fine-Tune Your AI's Personality
Adjust these dials to make your AI agents more creative or focused! ๐ฏ
# Default generation parameters
VIZRA_ADK_DEFAULT_TEMPERATURE=0.7 # null uses provider default
VIZRA_ADK_DEFAULT_MAX_TOKENS=2000 # null uses provider default
VIZRA_ADK_DEFAULT_TOP_P=0.9 # null uses provider default
๐ก๏ธ Temperature
Controls creativity: 0 = focused, 1 = wild imagination!
๐ฆ Max Tokens
Maximum response length. More tokens = longer answers!
๐ฉ Top P
Controls diversity. Lower = more focused responses!
๐ Your API Keys
Time to connect to the AI magic! Add your provider API keys:
# OpenAI
OPENAI_API_KEY=your-openai-api-key
# Anthropic Claude
ANTHROPIC_API_KEY=your-anthropic-api-key
# Google Gemini
GOOGLE_API_KEY=your-google-api-key
Security First!
Never commit API keys to your repository! Keep them safe in your .env
file
and add it to .gitignore
.
๐ The Complete Configuration Blueprint
Here's your complete configuration file in all its glory! ๐
return [
/**
* Default LLM provider to use with Prism-PHP.
* Options: 'openai', 'anthropic', 'gemini'
*/
'default_provider' => env('VIZRA_ADK_DEFAULT_PROVIDER', 'openai'),
/**
* Default LLM model to use.
* Example: 'gemini-pro', 'gpt-4-turbo', 'claude-3-opus-20240229'
*/
'default_model' => env('VIZRA_ADK_DEFAULT_MODEL', 'gemini-pro'),
/**
* Default generation parameters for LLM requests.
*/
'default_generation_params' => [
'temperature' => env('VIZRA_ADK_DEFAULT_TEMPERATURE', null),
'max_tokens' => env('VIZRA_ADK_DEFAULT_MAX_TOKENS', null),
'top_p' => env('VIZRA_ADK_DEFAULT_TOP_P', null),
],
/**
* Sub-agent delegation settings.
*/
'max_delegation_depth' => env('VIZRA_ADK_MAX_DELEGATION_DEPTH', 5),
/**
* Database table names used by the package.
*/
'tables' => [
'agent_sessions' => 'agent_sessions',
'agent_messages' => 'agent_messages',
'agent_memories' => 'agent_memories',
],
/**
* Tracing configuration.
*/
'tracing' => [
'enabled' => env('VIZRA_ADK_TRACING_ENABLED', true),
'table' => 'agent_trace_spans',
'cleanup_days' => env('VIZRA_ADK_TRACING_CLEANUP_DAYS', 30),
],
/**
* Namespaces for user-defined classes.
*/
'namespaces' => [
'agents' => 'App\\Agents',
'tools' => 'App\\Tools',
'evaluations' => 'App\\Evaluations',
],
/**
* Routes configuration.
*/
'routes' => [
'enabled' => true,
'prefix' => 'api/vizra-adk',
'middleware' => ['api'],
'web' => [
'enabled' => env('VIZRA_ADK_WEB_ENABLED', true),
'prefix' => 'vizra',
'middleware' => ['web'],
],
],
];
๐ค Agent Teamwork Settings
Let your agents work together! Control how deep the delegation rabbit hole goes:
# Maximum depth for nested sub-agent delegation
VIZRA_ADK_MAX_DELEGATION_DEPTH=5
Why This Matters
This clever safety net prevents your agents from playing endless "pass the task" โ avoiding infinite loops and keeping your app responsive!
๐๏ธ Database Architecture
Vizra ADK organizes your AI data in these neat tables:
๐ฌ agent_sessions
Keeps track of all your conversation sessions
โ๏ธ agent_messages
Stores the complete message history
๐ง agent_memories
Your agents' long-term memories live here
๐ agent_trace_spans
Debug traces for when you need to investigate
๐ก Tip: Got naming conflicts? No worries! You can customize these table names in your config file.
๐ Debug Like a Detective
Turn on tracing to see exactly what your agents are thinking! ๐ต๏ธโโ๏ธ
# Enable/disable tracing
VIZRA_ADK_TRACING_ENABLED=true
# Days to keep trace data before cleanup
VIZRA_ADK_TRACING_CLEANUP_DAYS=30
๐งน Spring Cleaning Command
Keep your database tidy by removing old traces:
php artisan vizra:trace:cleanup --days=7
๐ Web Dashboard Settings
Toggle your beautiful web dashboard on or off:
# Enable/disable web interface
VIZRA_ADK_WEB_ENABLED=true
Your shiny dashboard lives at these URLs:
๐ Main Dashboard
/vizra
๐ฌ Chat Interface
/vizra/chat
๐ Evaluation Runner
/vizra/eval
๐ The Configuration Priority Game
๐ฏ Who Wins? The Priority Order!
When multiple configs compete, here's who takes the crown (from highest to lowest priority):
Runtime Methods
$agent->setTemperature(0.2)
The boss! Always wins.
Agent Class Properties
protected ?float $temperature = 0.7;
The deputy! Steps in when the boss is away.
Environment Variables
VIZRA_ADK_DEFAULT_TEMPERATURE=0.5
The default go-to for most situations.
Config File Defaults
config/vizra-adk.php
The fallback! Always there when needed.
๐ฆ Organize Your Code
Keep your code neat and tidy with these default namespaces:
๐ค Agents
App\Agents
๐ง Tools
App\Tools
๐ Evaluations
App\Evaluations
๐จ Feeling creative? You can totally customize these namespaces in your config file to match your project's vibe!
๐ Environment Magic
Different settings for different environments? We've got you covered! ๐ฉโจ
๐ป Local Development
# .env.local
VIZRA_ADK_TRACING_ENABLED=true
VIZRA_ADK_DEFAULT_MODEL=gpt-3.5-turbo
VIZRA_ADK_WEB_ENABLED=true
Debug everything, use cheaper models!
๐ Production
# .env.production
VIZRA_ADK_TRACING_ENABLED=false
VIZRA_ADK_DEFAULT_MODEL=gpt-4-turbo
VIZRA_ADK_WEB_ENABLED=false
Optimized for performance & security!
๐ You're All Set!
Congratulations! Your Vizra ADK is now perfectly configured. Time to build some amazing AI agents! Remember, configuration is just the beginning of your journey. Let's explore what's next...