-
-
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: Support specifying tool choice in Assistant API in openai_dart (#…
…382)
- Loading branch information
1 parent
a864dae
commit 97d7977
Showing
10 changed files
with
4,697 additions
and
2,204 deletions.
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
packages/openai_dart/lib/src/generated/schema/assistants_function_call_option.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: AssistantsFunctionCallOption | ||
// ========================================== | ||
|
||
/// No Description | ||
@freezed | ||
class AssistantsFunctionCallOption with _$AssistantsFunctionCallOption { | ||
const AssistantsFunctionCallOption._(); | ||
|
||
/// Factory constructor for AssistantsFunctionCallOption | ||
const factory AssistantsFunctionCallOption({ | ||
/// The name of the function to call. | ||
required String name, | ||
}) = _AssistantsFunctionCallOption; | ||
|
||
/// Object construction from a JSON representation | ||
factory AssistantsFunctionCallOption.fromJson(Map<String, dynamic> json) => | ||
_$AssistantsFunctionCallOptionFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['name']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'name': name, | ||
}; | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
packages/openai_dart/lib/src/generated/schema/assistants_named_tool_choice.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,58 @@ | ||
// 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: AssistantsNamedToolChoice | ||
// ========================================== | ||
|
||
/// Specifies a tool the model should use. Use to force the model to call a specific tool. | ||
@freezed | ||
class AssistantsNamedToolChoice with _$AssistantsNamedToolChoice { | ||
const AssistantsNamedToolChoice._(); | ||
|
||
/// Factory constructor for AssistantsNamedToolChoice | ||
const factory AssistantsNamedToolChoice({ | ||
/// The type of the tool. If type is `function`, the function name must be set | ||
required AssistantsToolType type, | ||
|
||
/// No Description | ||
@JsonKey(includeIfNull: false) AssistantsFunctionCallOption? function, | ||
}) = _AssistantsNamedToolChoice; | ||
|
||
/// Object construction from a JSON representation | ||
factory AssistantsNamedToolChoice.fromJson(Map<String, dynamic> json) => | ||
_$AssistantsNamedToolChoiceFromJson(json); | ||
|
||
/// List of all property names of schema | ||
static const List<String> propertyNames = ['type', 'function']; | ||
|
||
/// Perform validations on the schema property values | ||
String? validateSchema() { | ||
return null; | ||
} | ||
|
||
/// Map representation of object (not serialized) | ||
Map<String, dynamic> toMap() { | ||
return { | ||
'type': type, | ||
'function': function, | ||
}; | ||
} | ||
} | ||
|
||
// ========================================== | ||
// ENUM: AssistantsToolType | ||
// ========================================== | ||
|
||
/// The type of the tool. If type is `function`, the function name must be set | ||
enum AssistantsToolType { | ||
@JsonValue('function') | ||
function, | ||
@JsonValue('code_interpreter') | ||
codeInterpreter, | ||
@JsonValue('retrieval') | ||
retrieval, | ||
} |
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.