copyWith method

Run copyWith({
  1. String? id,
  2. String? object,
  3. int? createdAt,
  4. String? threadId,
  5. String? assistantId,
  6. RunStatus? status,
  7. Object? requiredAction = unsetCopyWithValue,
  8. Object? lastError = unsetCopyWithValue,
  9. Object? expiresAt = unsetCopyWithValue,
  10. Object? startedAt = unsetCopyWithValue,
  11. Object? cancelledAt = unsetCopyWithValue,
  12. Object? failedAt = unsetCopyWithValue,
  13. Object? completedAt = unsetCopyWithValue,
  14. Object? incompleteDetails = unsetCopyWithValue,
  15. String? model,
  16. Object? instructions = unsetCopyWithValue,
  17. List<AssistantTool>? tools,
  18. Map<String, String>? metadata,
  19. Object? usage = unsetCopyWithValue,
  20. Object? temperature = unsetCopyWithValue,
  21. Object? topP = unsetCopyWithValue,
  22. Object? maxPromptTokens = unsetCopyWithValue,
  23. Object? maxCompletionTokens = unsetCopyWithValue,
  24. Object? truncationStrategy = unsetCopyWithValue,
  25. Object? toolChoice = unsetCopyWithValue,
  26. Object? parallelToolCalls = unsetCopyWithValue,
  27. Object? responseFormat = unsetCopyWithValue,
})

Creates a copy with the given fields replaced.

Implementation

Run copyWith({
  String? id,
  String? object,
  int? createdAt,
  String? threadId,
  String? assistantId,
  RunStatus? status,
  Object? requiredAction = unsetCopyWithValue,
  Object? lastError = unsetCopyWithValue,
  Object? expiresAt = unsetCopyWithValue,
  Object? startedAt = unsetCopyWithValue,
  Object? cancelledAt = unsetCopyWithValue,
  Object? failedAt = unsetCopyWithValue,
  Object? completedAt = unsetCopyWithValue,
  Object? incompleteDetails = unsetCopyWithValue,
  String? model,
  Object? instructions = unsetCopyWithValue,
  List<AssistantTool>? tools,
  Map<String, String>? metadata,
  Object? usage = unsetCopyWithValue,
  Object? temperature = unsetCopyWithValue,
  Object? topP = unsetCopyWithValue,
  Object? maxPromptTokens = unsetCopyWithValue,
  Object? maxCompletionTokens = unsetCopyWithValue,
  Object? truncationStrategy = unsetCopyWithValue,
  Object? toolChoice = unsetCopyWithValue,
  Object? parallelToolCalls = unsetCopyWithValue,
  Object? responseFormat = unsetCopyWithValue,
}) {
  return Run(
    id: id ?? this.id,
    object: object ?? this.object,
    createdAt: createdAt ?? this.createdAt,
    threadId: threadId ?? this.threadId,
    assistantId: assistantId ?? this.assistantId,
    status: status ?? this.status,
    requiredAction: requiredAction == unsetCopyWithValue
        ? this.requiredAction
        : requiredAction as RequiredAction?,
    lastError: lastError == unsetCopyWithValue
        ? this.lastError
        : lastError as RunError?,
    expiresAt: expiresAt == unsetCopyWithValue
        ? this.expiresAt
        : expiresAt as int?,
    startedAt: startedAt == unsetCopyWithValue
        ? this.startedAt
        : startedAt as int?,
    cancelledAt: cancelledAt == unsetCopyWithValue
        ? this.cancelledAt
        : cancelledAt as int?,
    failedAt: failedAt == unsetCopyWithValue
        ? this.failedAt
        : failedAt as int?,
    completedAt: completedAt == unsetCopyWithValue
        ? this.completedAt
        : completedAt as int?,
    incompleteDetails: incompleteDetails == unsetCopyWithValue
        ? this.incompleteDetails
        : incompleteDetails as RunIncompleteDetails?,
    model: model ?? this.model,
    instructions: instructions == unsetCopyWithValue
        ? this.instructions
        : instructions as String?,
    tools: tools ?? this.tools,
    metadata: metadata ?? this.metadata,
    usage: usage == unsetCopyWithValue ? this.usage : usage as Usage?,
    temperature: temperature == unsetCopyWithValue
        ? this.temperature
        : temperature as double?,
    topP: topP == unsetCopyWithValue ? this.topP : topP as double?,
    maxPromptTokens: maxPromptTokens == unsetCopyWithValue
        ? this.maxPromptTokens
        : maxPromptTokens as int?,
    maxCompletionTokens: maxCompletionTokens == unsetCopyWithValue
        ? this.maxCompletionTokens
        : maxCompletionTokens as int?,
    truncationStrategy: truncationStrategy == unsetCopyWithValue
        ? this.truncationStrategy
        : truncationStrategy as TruncationStrategy?,
    toolChoice: toolChoice == unsetCopyWithValue
        ? this.toolChoice
        : toolChoice as ToolChoice?,
    parallelToolCalls: parallelToolCalls == unsetCopyWithValue
        ? this.parallelToolCalls
        : parallelToolCalls as bool?,
    responseFormat: responseFormat == unsetCopyWithValue
        ? this.responseFormat
        : responseFormat as ResponseFormat?,
  );
}