-
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(openai_dart): Handle nullable function call fields when streaming (…
- Loading branch information
1 parent
cd71963
commit 8f23cf1
Showing
6 changed files
with
293 additions
and
15 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...es/openai_dart/lib/src/generated/schema/chat_completion_stream_message_function_call.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// coverage:ignore-file | ||
// GENERATED CODE - DO NOT MODIFY BY HAND | ||
// ignore_for_file: type=lint | ||
// ignore_for_file: invalid_annotation_target | ||
part of open_a_i_schema; | ||
|
||
// ========================================== | ||
// CLASS: ChatCompletionStreamMessageFunctionCall | ||
// ========================================== | ||
|
||
/// The name and arguments of a function that should be called, as generated by the model. | ||
@freezed | ||
class ChatCompletionStreamMessageFunctionCall | ||
with _$ChatCompletionStreamMessageFunctionCall { | ||
const ChatCompletionStreamMessageFunctionCall._(); | ||
|
||
/// Factory constructor for ChatCompletionStreamMessageFunctionCall | ||
const factory ChatCompletionStreamMessageFunctionCall({ | ||
/// The name of the function to call. | ||
@JsonKey(includeIfNull: false) String? name, | ||
|
||
/// The arguments to call the function with, as generated by the model in JSON format. Note that the model does not always generate valid JSON, and may hallucinate parameters not defined by your function schema. Validate the arguments in your code before calling your function. | ||
@JsonKey(includeIfNull: false) String? arguments, | ||
}) = _ChatCompletionStreamMessageFunctionCall; | ||
|
||
/// Object construction from a JSON representation | ||
factory ChatCompletionStreamMessageFunctionCall.fromJson( | ||
Map<String, dynamic> json) => | ||
_$ChatCompletionStreamMessageFunctionCallFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['name', 'arguments']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'name': name, | ||
'arguments': arguments, | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.