Function model

  • model decorator to associate a model identifier and configuration with an agent.

    Parameters

    Returns ClassDecorator

    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.5,
    maxRetries: 3,
    maxSteps: 3,
    toolChoice: 'auto'
    })
    class MyConfiguredAgent extends Agent<string, string> {}