copyWith method

AIConfig copyWith({
  1. String? apiKey,
  2. String? model,
  3. int? maxTokens,
  4. double? temperature,
  5. double? topP,
  6. String? baseUrl,
  7. Duration? timeout,
  8. String? systemPrompt,
  9. Map<String, dynamic>? extraParams,
  10. int? maxAttachmentBytes,
})

Creates a copy with modified fields.

Implementation

AIConfig copyWith({
  String? apiKey,
  String? model,
  int? maxTokens,
  double? temperature,
  double? topP,
  String? baseUrl,
  Duration? timeout,
  String? systemPrompt,
  Map<String, dynamic>? extraParams,
  int? maxAttachmentBytes,
}) {
  return AIConfig(
    apiKey: apiKey ?? this.apiKey,
    model: model ?? this.model,
    maxTokens: maxTokens ?? this.maxTokens,
    temperature: temperature ?? this.temperature,
    topP: topP ?? this.topP,
    baseUrl: baseUrl ?? this.baseUrl,
    timeout: timeout ?? this.timeout,
    systemPrompt: systemPrompt ?? this.systemPrompt,
    extraParams: extraParams ?? this.extraParams,
    maxAttachmentBytes: maxAttachmentBytes ?? this.maxAttachmentBytes,
  );
}