NocAIConfig class Null safety

Configuration for a NocAI instance.

Holds all connection parameters including the API key, base URL, model name, and auto-detected provider type.

Constructors

NocAIConfig({required String apiKey, required String baseUrl, required String model, NocProvider? provider, double? temperature, int? maxTokens, String? systemPrompt, Duration connectTimeout = const Duration(seconds: 30), Duration receiveTimeout = const Duration(seconds: 120)})
Creates a NocAIConfig with the given parameters.

Properties

apiKey String
API key for authentication.
final
baseUrl String
Base URL of the LLM API endpoint.
final
connectTimeout Duration
Connection timeout duration.
final
hashCode int
The hash code for this object.
read-only, inherited
host String
Extracts the host from the base URL.
read-only
isGeminiNative bool
Whether this config targets the Gemini Native API.
read-only
isHTTPS bool
Whether the base URL uses HTTPS.
read-only
maxTokens int?
Optional maximum tokens for the response.
final
model String
Model identifier (e.g., 'gpt-3.5-turbo', 'gemini-1.5-flash').
final
path String
Extracts the path from the base URL.
read-only
port int
Extracts the port from the base URL.
read-only
provider NocProvider
Auto-detected or manually specified provider type.
final
receiveTimeout Duration
Receive/read timeout duration.
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
systemPrompt String?
Optional system prompt prepended to conversations.
final
temperature double?
Optional temperature parameter (0.0 - 2.0).
final

Methods

copyWith({String? apiKey, String? baseUrl, String? model, NocProvider? provider, double? temperature, int? maxTokens, String? systemPrompt, Duration? connectTimeout, Duration? receiveTimeout}) NocAIConfig
Creates a copy of this config with optional overrides.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited