The model identifier string. List of model identifiers available at https://axar-ai.gitbook.io/axar/basics/model
Optionalconfig: ModelConfigOptional configuration for the model
Maximum number of tokens to generate
Sampling temperature between 0 and 1. Use either temperature or topP, not both.
Nucleus sampling threshold. Sample from tokens whose cumulative probability exceeds topP. Use either temperature or topP, not both.
Only sample from the top K options for each subsequent token. Recommended for advanced use cases only.
Penalize tokens based on their presence in the prompt and generated text. Value between -2.0 and 2.0.
Penalize tokens based on their frequency in the generated text. Value between -2.0 and 2.0.
Maximum number of retries for failed requests (defaults to 2 in SDK)
Maximum number of steps for tool calling (defaults to 3)
Tool choice mode - 'auto' or 'none'
A class decorator function.
// Basic usage
@model('openai:gpt-4-mini')
class MyAgent extends Agent<string, string> {}
// With configuration
@model('openai:gpt-4-mini', {
maxTokens: 100,
temperature: 0.7,
maxRetries: 3,
maxSteps: 5,
toolChoice: 'auto'
})
class MyConfiguredAgent extends Agent<string, string> {}
// With advanced sampling parameters
@model('openai:gpt-4-mini', {
topP: 0.9, // nucleus sampling
topK: 50, // top-k sampling
presencePenalty: 0.6, // reduce repetition
frequencyPenalty: 0.5 // reduce common tokens
})
class CreativeAgent extends Agent<string, string> {}
modeldecorator to associate a model identifier and configuration with an agent.