LlmBackedUserSimulatorConfig constructor

LlmBackedUserSimulatorConfig({
  1. String type = 'llm_backed',
  2. String model = 'gemini-2.5-flash',
  3. GenerateContentConfig? modelConfiguration,
  4. int maxAllowedInvocations = 20,
  5. String? customInstructions,
  6. bool includeFunctionCalls = false,
  7. Map<String, Object?>? values,
})

Creates configuration for an LLM-backed user simulator.

Implementation

LlmBackedUserSimulatorConfig({
  this.type = 'llm_backed',
  this.model = 'gemini-2.5-flash',
  GenerateContentConfig? modelConfiguration,
  this.maxAllowedInvocations = 20,
  this.customInstructions,
  this.includeFunctionCalls = false,
  super.values,
}) : modelConfiguration =
         modelConfiguration ??
         GenerateContentConfig(
           thinkingConfig: <String, Object?>{
             'include_thoughts': true,
             'thinking_budget': 10240,
           },
         ) {
  if (customInstructions != null &&
      !isValidUserSimulatorTemplate(
        customInstructions!,
        requiredParams: <String>[
          'stop_signal',
          'conversation_plan',
          'conversation_history',
        ],
      )) {
    throw ArgumentError(
      'customInstructions must include placeholders: '
      '{{ stop_signal }}, {{ conversation_plan }}, '
      '{{ conversation_history }}',
    );
  }
}