-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
207 additions
and
9 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import 'client/client.dart'; | ||
|
||
class Assistants { | ||
final OpenAIClient _client; | ||
Assistants(this._client); | ||
} |
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,19 @@ | ||
import 'package:chat_gpt_sdk/chat_gpt_sdk.dart'; | ||
|
||
sealed class AssistantModel { | ||
final String model; | ||
|
||
AssistantModel({required this.model}); | ||
} | ||
|
||
class GptTurbo0301Model extends AssistantModel { | ||
GptTurbo0301Model() : super(model: kChatGptTurbo0301Model); | ||
} | ||
|
||
class GptTurbo1106Model extends AssistantModel { | ||
GptTurbo1106Model() : super(model: kChatGptTurbo1106); | ||
} | ||
|
||
class Gpt41106PreviewModel extends AssistantModel { | ||
Gpt41106PreviewModel() : super(model: kGpt41106Preview); | ||
} |
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,69 @@ | ||
import 'package:chat_gpt_sdk/src/model/assistant/enum/assistant_model.dart'; | ||
|
||
class Assistant { | ||
///ID of the model to use. You can use the List models | ||
/// API to see all of your available models, or see our Model | ||
/// overview for descriptions of them. | ||
/// [model] | ||
final AssistantModel model; | ||
|
||
///The name of the assistant. The maximum length is 256 characters. | ||
///[name] | ||
final String? name; | ||
|
||
///The description of the assistant. The maximum length is 512 characters. | ||
///[description] | ||
final String? description; | ||
|
||
///The system instructions that the assistant uses. | ||
/// The maximum length is 32768 characters. | ||
/// [instructions] | ||
final String? instructions; | ||
|
||
///A list of tool enabled on the assistant. | ||
/// There can be a maximum of 128 tools per assistant. | ||
/// Tools can be of types code_interpreter, retrieval, or | ||
/// https://platform.openai.com/docs/api-reference/assistants/createAssistant | ||
/// ### Code Interpreter | ||
/// "tools": [ | ||
/// { "type": "code_interpreter" } | ||
/// ] | ||
///### Enabling Retrieval | ||
///"tools": [{"type": "retrieval"}] | ||
/// [tools] | ||
final List? tools; | ||
|
||
///A list of file IDs attached to this assistant. | ||
/// There can be a maximum of 20 files attached to the assistant. | ||
/// Files are ordered by their creation date in ascending order. | ||
/// [fileIds] | ||
final List? fileIds; | ||
|
||
///Set of 16 key-value pairs that can be attached to an object. | ||
/// This can be useful for storing additional information | ||
/// about the object in a structured format. | ||
/// Keys can be a maximum of 64 characters | ||
/// long and values can be a maxium of 512 characters long. | ||
/// [metadata] | ||
final Map? metadata; | ||
|
||
Assistant({ | ||
required this.model, | ||
this.name, | ||
this.description, | ||
this.instructions, | ||
this.tools, | ||
this.fileIds, | ||
this.metadata, | ||
}); | ||
|
||
Map<String, dynamic> toJson() => Map.of({ | ||
"model": model.model, | ||
'name': name, | ||
'description': description, | ||
'instructions': instructions, | ||
'tools': tools ?? [], | ||
'file_ids': fileIds ?? [], | ||
'metadata': metadata ?? {}, | ||
}); | ||
} |
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
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