copyWith method

AssistantConfig copyWith({
  1. Toolkit? toolkit,
  2. PromptLayout? prompt,
  3. ModelProfile? profile,
  4. ReplyStrategy? replies,
  5. ConfirmationPolicy? confirmation,
  6. ListReferences? listReferences,
  7. ScreenRequestMapper? screenRequests,
  8. List<OutputGuard>? guards,
  9. OutputRewriter? rewriter,
  10. TurnHook? beforeModel,
  11. ToolGate? beforeTool,
  12. AssistantStrings? strings,
  13. GrammarOptions? grammar,
  14. SamplingOptions? sampling,
  15. Duration? toolStatusDelay,
  16. Duration? toolTimeout,
  17. ToolErrorPolicy? toolErrors,
  18. DateTime today()?,
  19. bool? restoreOpenQuestion,
})

A copy with the given fields replaced (a null argument keeps the current value).

Implementation

AssistantConfig copyWith({
  Toolkit? toolkit,
  PromptLayout? prompt,
  ModelProfile? profile,
  ReplyStrategy? replies,
  ConfirmationPolicy? confirmation,
  ListReferences? listReferences,
  ScreenRequestMapper? screenRequests,
  List<OutputGuard>? guards,
  OutputRewriter? rewriter,
  TurnHook? beforeModel,
  ToolGate? beforeTool,
  AssistantStrings? strings,
  GrammarOptions? grammar,
  SamplingOptions? sampling,
  Duration? toolStatusDelay,
  Duration? toolTimeout,
  ToolErrorPolicy? toolErrors,
  DateTime Function()? today,
  bool? restoreOpenQuestion,
}) => AssistantConfig(
  toolkit: toolkit ?? this.toolkit,
  prompt: prompt ?? this.prompt,
  profile: profile ?? this.profile,
  replies: replies ?? this.replies,
  confirmation: confirmation ?? this.confirmation,
  listReferences: listReferences ?? this.listReferences,
  screenRequests: screenRequests ?? this.screenRequests,
  guards: guards ?? this.guards,
  rewriter: rewriter ?? this.rewriter,
  beforeModel: beforeModel ?? this.beforeModel,
  beforeTool: beforeTool ?? this.beforeTool,
  strings: strings ?? this.strings,
  grammar: grammar ?? this.grammar,
  sampling: sampling ?? this.sampling,
  toolStatusDelay: toolStatusDelay ?? this.toolStatusDelay,
  toolTimeout: toolTimeout ?? this.toolTimeout,
  toolErrors: toolErrors ?? this.toolErrors,
  today: today ?? this.today,
  restoreOpenQuestion: restoreOpenQuestion ?? this.restoreOpenQuestion,
);