-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: Introduce Thread model and createThread API method * feat: Introduce addThreadMessage method * feat: Add the rest of the models and calls for Assistant Thread API * refactor: Rename Trascription to TraNscription * feat: Add documentation * chore: Update CHANGELOG.md
- Loading branch information
Showing
20 changed files
with
3,915 additions
and
12 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
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,5 @@ | ||
export './thread.dart'; | ||
export './thread_message.dart'; | ||
export './thread_run.dart'; | ||
export './thread_run_step.dart'; | ||
export './thread_requests.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,28 @@ | ||
import 'package:freezed_annotation/freezed_annotation.dart'; | ||
|
||
part 'thread.freezed.dart'; | ||
|
||
part 'thread.g.dart'; | ||
|
||
/// Represents a thread that contains messages. | ||
/// https://platform.openai.com/docs/api-reference/threads | ||
@freezed | ||
class Thread with _$Thread { | ||
factory Thread({ | ||
/// The identifier, which can be referenced in API endpoints. | ||
required String id, | ||
|
||
/// The object type, which is always thread. | ||
@Default('thread') String object, | ||
|
||
/// The Unix timestamp (in seconds) for when the thread was created. | ||
required int createdAt, | ||
|
||
/// 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. | ||
@Default(<String, dynamic>{}) Map<String, dynamic> metadata, | ||
}) = _Thread; | ||
|
||
factory Thread.fromJson(Map<String, dynamic> json) => _$ThreadFromJson(json); | ||
} |
Oops, something went wrong.