Configuration¶
Sikka Agent provides flexible configuration options through environment variables, Python code, and configuration files.
Environment Variables¶
Sikka Agent automatically loads environment variables from .env
files when the package is imported. This simplifies configuration management by allowing you to define sensitive keys and other settings in a local file.
The system looks for .env
files in the following locations (in order of precedence):
1. Project root directory (where setup.py or pyproject.toml is located)
2. The current working directory
3. The user's home directory
For example, to configure your AWS credentials, create a .env
file in your project's root directory:
This will automatically be loaded when you import any module from the sikkaagent
package.
Important Environment Variables¶
AWS_ACCESS_KEY_ID
: Your AWS access key (required for AWS Bedrock models)AWS_SECRET_ACCESS_KEY
: Your AWS secret key (required for AWS Bedrock models)- Any other environment variables used by your agents or tools
Configuration in Code¶
You can also provide configuration directly in code when initializing components:
from sikkaagent.models import ModelConfigure, ModelConfig
# Override the API key during model configuration
model = ModelConfigure(
model="llama3.1:8b",
model_platform=ModelPlatformType.OLLAMA,
url="http://localhost:11434/v1"
config=ModelConfig(temperature=0.7)
)
Advanced Configuration¶
For more advanced scenarios, you can manually trigger environment loading:
from sikkaagent.utils import load_env_files
# Manually reload environment variables
load_env_files()
This can be useful if you dynamically change your environment or need to reload settings during runtime.