copyWith method

FluenticConfig copyWith({
  1. String? apiKey,
  2. String? model,
  3. String? baseUrl,
  4. String? defaultSystemPrompt,
  5. bool clearDefaultSystemPrompt = false,
})

Implementation

FluenticConfig copyWith({
  String? apiKey,
  String? model,
  String? baseUrl,
  String? defaultSystemPrompt, // AllowcopyWith for system prompt
  bool clearDefaultSystemPrompt = false, // To explicitly set it to null
}) {
  return FluenticConfig(
    apiKey: apiKey ?? this.apiKey,
    model: model ?? this.model,
    baseUrl: baseUrl ?? this.baseUrl,
    defaultSystemPrompt:
        clearDefaultSystemPrompt
            ? null
            : (defaultSystemPrompt ?? this.defaultSystemPrompt),
  );
}