whenOrNull<TResult extends Object?> method
- @optionalTypeArgs
- TResult? system(
- ChatCompletionMessageRole role,
- String content,
- String? name
- TResult? user(
- ChatCompletionMessageRole role,
- ChatCompletionUserMessageContent content,
- String? name
- TResult? assistant(
- ChatCompletionMessageRole role,
- String? content,
- String? refusal,
- String? name,
- List<
ChatCompletionMessageToolCall> ? toolCalls, - ChatCompletionMessageFunctionCall? functionCall,
- ChatCompletionAssistantMessageAudio? audio,
- TResult? tool(
- ChatCompletionMessageRole role,
- String content,
- String toolCallId
- TResult? function(
- ChatCompletionMessageRole role,
- String? content,
- String name
inherited
Implementation
@optionalTypeArgs
TResult? whenOrNull<TResult extends Object?>({
TResult? Function(ChatCompletionMessageRole role, String content,
@JsonKey(includeIfNull: false) String? name)?
system,
TResult? Function(
ChatCompletionMessageRole role,
@_ChatCompletionUserMessageContentConverter()
ChatCompletionUserMessageContent content,
@JsonKey(includeIfNull: false) String? name)?
user,
TResult? Function(
ChatCompletionMessageRole role,
@JsonKey(includeIfNull: false) String? content,
@JsonKey(includeIfNull: false) String? refusal,
@JsonKey(includeIfNull: false) String? name,
@JsonKey(name: 'tool_calls', includeIfNull: false)
List<ChatCompletionMessageToolCall>? toolCalls,
@JsonKey(name: 'function_call', includeIfNull: false)
ChatCompletionMessageFunctionCall? functionCall,
@JsonKey(includeIfNull: false)
ChatCompletionAssistantMessageAudio? audio)?
assistant,
TResult? Function(ChatCompletionMessageRole role, String content,
@JsonKey(name: 'tool_call_id') String toolCallId)?
tool,
TResult? Function(
ChatCompletionMessageRole role, String? content, String name)?
function,
}) =>
throw _privateConstructorUsedError;