From ca74252aefc3c9b25738386c0f0afcfe9e4225b4 Mon Sep 17 00:00:00 2001 From: "redev.rx" Date: Tue, 30 Jul 2024 10:37:20 +0700 Subject: [PATCH] add new docs --- CHANGELOG.md | 6 +++++- README.md | 21 ++++++++++++++++++- example/pubspec.lock | 2 +- .../thread/response/thread_response.dart | 4 +++- pubspec.yaml | 2 +- 5 files changed, 30 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5632433..39faea2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -240,4 +240,8 @@ ## 3.0.9 - Assistants v2 -- Deprecate API \ No newline at end of file +- Deprecate API + +## 3.1.0 + - Add Gpt 4o mini + - Add Doc API version 2 (Assistants v2) \ No newline at end of file diff --git a/README.md b/README.md index 6d57870..83cbb71 100644 --- a/README.md +++ b/README.md @@ -47,11 +47,13 @@ supervised and reinforcement learning techniques. - [Modify assistant](#modify-assistant) - [Delete assistant](#delete-assistant) - [Delete assistant file](#delete-assistant-file) + - [Using Assistants V2](#using-assistant-v2) - [Threads](#threads) - [Create thread](#Create-threads) - [Retrieve thread](#Retrieve-thread) - [Modify thread](#Modify-thread) - [Delete thread](#Delete-thread) + - [Using Thread V2](#using-thread-v2) - [Messages](#messages) - [Create message](#Create-message) - [List messages](#List-messages) @@ -59,6 +61,7 @@ supervised and reinforcement learning techniques. - [Retrieve message](#Retrieve-message) - [Retrieve message file](#Retrieve-message-file) - [Modify message](#Modify-message) + - [Using Message V2](#using-message-v2) - [Runs](#runs) - [Create run](#Create-run) - [Create thread and run](#Create-thread-and-run) @@ -111,7 +114,7 @@ supervised and reinforcement learning techniques. ## Install Package ```dart -chat_gpt_sdk: 3.0.8 +chat_gpt_sdk: 3.1.0 ``` ## Create OpenAI Instance @@ -414,6 +417,11 @@ void createAssistantFile() async { } ``` +- ## Using assistant v2 +```dart +openAI.assistant.v2; +``` + ## Threads - ### Create threads ```dart @@ -466,6 +474,11 @@ void createThreads() async { } ``` +- ## Using Thread V2 +```dart +openAI.threads.v2; +``` + ## Messages - ### Create Message ```dart @@ -530,6 +543,12 @@ void retrieveMessageFile() async { ); } ``` + +- ## Using Message V2 +```dart +openAI.threads.v2.messages; +``` + ## Runs - ### Create run ```dart diff --git a/example/pubspec.lock b/example/pubspec.lock index dbd425b..2cdfc2f 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "3.0.9" + version: "3.1.0" clock: dependency: transitive description: diff --git a/lib/src/model/thread/response/thread_response.dart b/lib/src/model/thread/response/thread_response.dart index bc5e985..bc8c6b0 100644 --- a/lib/src/model/thread/response/thread_response.dart +++ b/lib/src/model/thread/response/thread_response.dart @@ -18,7 +18,9 @@ class ThreadResponse { createdAt: json["created_at"] ?? 0, id: json["id"] ?? '', object: json["object"] ?? '', - toolResources: json['tool_resources'] is Map ? json['tool_resources'] : null); + toolResources: json['tool_resources'] is Map + ? json['tool_resources'] + : null); Map toJson() => { "metadata": metadata, diff --git a/pubspec.yaml b/pubspec.yaml index 85191fb..af4812e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: chat_gpt_sdk description: create chat bot and other bot with ChatGPT SDK Support GPT-4 , 3.5 and SSE Generate Prompt (Stream) -version: 3.0.9 +version: 3.1.0 homepage: https://www.facebook.com/REDEVRX repository: https://github.com/redevRx/Flutter-ChatGPT