Configuration
Fine-tune your agent's behavior
@model('openai:gpt-4', {
maxTokens: 100,
temperature: 0.5,
maxRetries: 3,
maxSteps: 3,
toolChoice: 'auto'
})
class MyAgent extends Agent<string, string> {}Configuration options
Option
Type
Default
Description
Example usage
// Basic usage without configuration
@model('openai:gpt-4')
class SimpleAgent extends Agent<string, string> {}
// With partial configuration
@model('openai:gpt-4', {
maxTokens: 100,
temperature: 0.7
})
class ConfiguredAgent extends Agent<string, string> {}
// With full configuration
@model('openai:gpt-4', {
maxTokens: 150,
temperature: 0.5,
maxRetries: 3,
maxSteps: 5,
toolChoice: 'auto'
})
class FullyConfiguredAgent extends Agent<string, string> {}Best practices
Last updated