ModelPreset
The ModelPreset class defines the preset configuration for AI models.
Properties
model(str): Name of the AI model (e.g. gpt-3.5-turbo)name(str): Identifier name for current preset, defaults to "default"base_url(str): Base address of API service (uses OpenAI default if empty)api_key(str): Key required to access APIprotocol(str): Protocol adapter type, defaults to "main"config(ModelConfig): Model configuration objectthinking_config(ThinkingConfig | None): Thinking/reasoning configuration for models that support it (e.g., OpenAI o1, Anthropic extended thinking)rate(float | None): Token cost rate for the model, used for cost estimationextra(dict[str, Any]): Extra configuration items
Methods
load(path: Path): Load model preset configuration from the specified pathsave(path: Path): Save current preset configuration to the specified path
Description
The ModelPreset class inherits from BaseModel and is used to encapsulate complete configuration information for AI models. It not only includes basic model parameters but also provides functionality to load and save configuration files, facilitating management and reuse of different model configurations.
