ApiConfig class
Configuration for the API provider.
Constructors
-
ApiConfig({required ApiProviderType type, required String baseUrl, String? apiKey, required String model, int maxTokens = 16384, Map<
String, String> extraHeaders = const {}}) -
const
- ApiConfig.anthropic({required String apiKey, String model = 'claude-sonnet-4-20250514', int maxTokens = 16384})
-
Default Anthropic configuration.
factory
- ApiConfig.deepseek({required String apiKey, String baseUrl = 'https://api.deepseek.com/v1', String model = 'deepseek-chat', int maxTokens = 32768})
-
DeepSeek.
factory
- ApiConfig.gemini({required String apiKey, String baseUrl = 'https://generativelanguage.googleapis.com/v1beta', String model = 'gemini-2.5-flash', int maxTokens = 65536})
-
Google Gemini.
factory
- ApiConfig.ollama({String baseUrl = 'http://localhost:11434/v1', String model = 'llama3.1', int maxTokens = 16384})
-
Local Ollama instance.
factory
- ApiConfig.openai({String? apiKey, String baseUrl = 'https://api.openai.com/v1', String model = 'gpt-4o', int maxTokens = 16384})
-
OpenAI-compatible provider (OpenAI, Ollama, DeepSeek, etc).
factory
- ApiConfig.qwen({required String apiKey, String baseUrl = 'https://dashscope.aliyuncs.com/compatible-mode/v1', String model = 'qwen-plus', int maxTokens = 32768})
-
Alibaba Qwen (DashScope).
factory
Properties
- apiKey → String?
-
API key for authentication (null for keyless providers like Ollama).
final
- baseUrl → String
-
Base URL for the API endpoint.
final
-
extraHeaders
→ Map<
String, String> -
Additional HTTP headers sent with every request.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxTokens → int
-
Maximum output tokens per completion.
final
- model → String
-
Model identifier to use for completions.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- type → ApiProviderType
-
The provider backend to use.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited