-
-
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.
feat: Add support for stream_options in openai_dart (#405)
- Loading branch information
1 parent
d76c6ab
commit c15714c
Showing
10 changed files
with
514 additions
and
37 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/openai_dart/lib/src/generated/schema/chat_completion_stream_options.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,40 @@ | ||
// 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: ChatCompletionStreamOptions | ||
// ========================================== | ||
|
||
/// Options for streaming response. Only set this when you set `stream: true`. | ||
@freezed | ||
class ChatCompletionStreamOptions with _$ChatCompletionStreamOptions { | ||
const ChatCompletionStreamOptions._(); | ||
|
||
/// Factory constructor for ChatCompletionStreamOptions | ||
const factory ChatCompletionStreamOptions({ | ||
/// If set, an additional chunk will be streamed before the `data: [DONE]` message. The `usage` field on this chunk shows the token usage statistics for the entire request, and the `choices` field will always be an empty array. All other chunks will also include a `usage` field, but with a null value. | ||
@JsonKey(name: 'include_usage', includeIfNull: false) bool? includeUsage, | ||
}) = _ChatCompletionStreamOptions; | ||
|
||
/// Object construction from a JSON representation | ||
factory ChatCompletionStreamOptions.fromJson(Map<String, dynamic> json) => | ||
_$ChatCompletionStreamOptionsFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['include_usage']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'include_usage': includeUsage, | ||
}; | ||
} | ||
} |
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
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.