copyWith method

GroqChatSettings copyWith({
  1. double? temperature,
  2. int? maxTokens,
  3. double? topP,
  4. bool? stream,
  5. String? stop,
  6. int? choicesCount,
  7. int? maxConversationalMemoryLength,
})

Returns a copy of the current GroqChatSettings object with the new values temperature controls randomness of responses.
maxTokens maximum number of tokens that can be generated in the chat completion.
topP method of text generation where a model will only consider the most probable next tokens that make up the probability p.
stream user server-side events to send the completion in small deltas rather than in a single batch after all processing has finished.
choicesCount how many chat completion choices to generate for each input message.
stop a stop sequence is a predefined or user-specified text string that signals an AI to stop generating content. maxConversationalMemoryLength conversational memory length. The number of previous messages to include in the model's context. A higher value will result in more context-aware responses. Example:

final newSettings = settings.copyWith(temperature: 0.5);

Implementation

GroqChatSettings copyWith({
  double? temperature,
  int? maxTokens,
  double? topP,
  bool? stream,
  String? stop,
  int? choicesCount,
  int? maxConversationalMemoryLength,
}) {
  return GroqChatSettings(
    temperature: temperature ?? this.temperature,
    maxTokens: maxTokens ?? this.maxTokens,
    topP: topP ?? this.topP,
    stop: stop ?? this.stop,
    maxConversationalMemoryLength:
        maxConversationalMemoryLength ?? this.maxConversationalMemoryLength,
  );
}