diff --git a/CHANGELOG.md b/CHANGELOG.md index 1502c1a..dac382a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -214,4 +214,6 @@ - Modifies a run. - Submit tool outputs to run - Cancel a run +# 3.0.2 + - Fix bugs \ No newline at end of file diff --git a/README.md b/README.md index ebaadf6..4d3fdd7 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ supervised and reinforcement learning techniques. ## Install Package ```dart -chat_gpt_sdk: 3.0.1 +chat_gpt_sdk: 3.0.2 ``` ## Create OpenAI Instance @@ -889,8 +889,8 @@ void audioTranscribe() async { final request = SpeechRequest( model: 'tts-1', input: 'The quick brown fox jumped over the lazy dog.'); - final response = await openAI.audio - .createSpeech(request: request, fileName: '', savePath: ''); + final List response = await openAI.audio + .createSpeech(request: request); } ``` diff --git a/example/pubspec.lock b/example/pubspec.lock index 9e8b4b5..bf774c5 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -31,7 +31,7 @@ packages: path: ".." relative: true source: path - version: "3.0.1" + version: "3.0.2" clock: dependency: transitive description: @@ -52,10 +52,10 @@ packages: dependency: transitive description: name: cross_file - sha256: "445db18de832dba8d851e287aff8ccf169bed30d2e94243cb54c7d2f1ed2142c" + sha256: "55d7b444feb71301ef6b8838dbc1ae02e63dd48c8773f3810ff53bb1e2945b32" url: "https://pub.dev" source: hosted - version: "0.3.3+6" + version: "0.3.4+1" cupertino_icons: dependency: "direct main" description: @@ -68,10 +68,10 @@ packages: dependency: transitive description: name: dio - sha256: "797e1e341c3dd2f69f2dad42564a6feff3bfb87187d05abb93b9609e6f1645c3" + sha256: "49af28382aefc53562459104f64d16b9dfd1e8ef68c862d5af436cc8356ce5a8" url: "https://pub.dev" source: hosted - version: "5.4.0" + version: "5.4.1" fake_async: dependency: transitive description: @@ -84,10 +84,10 @@ packages: dependency: transitive description: name: ffi - sha256: "7bf0adc28a23d395f19f3f1eb21dd7cfd1dd9f8e1c50051c069122e6853bc878" + sha256: "493f37e7df1804778ff3a53bd691d8692ddf69702cf4c1c1096a2e41b4779e21" url: "https://pub.dev" source: hosted - version: "2.1.0" + version: "2.1.2" file_selector_linux: dependency: transitive description: @@ -108,10 +108,10 @@ packages: dependency: transitive description: name: file_selector_platform_interface - sha256: "0aa47a725c346825a2bd396343ce63ac00bda6eff2fbc43eabe99737dede8262" + sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b url: "https://pub.dev" source: hosted - version: "2.6.1" + version: "2.6.2" file_selector_windows: dependency: transitive description: @@ -155,10 +155,10 @@ packages: dependency: transitive description: name: http - sha256: "759d1a329847dd0f39226c688d3e06a6b8679668e350e2891a6474f8b4bb8525" + sha256: "761a297c042deedc1ffbb156d6e2af13886bb305c2a343a4d972504cd67dd938" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.1" http_parser: dependency: transitive description: @@ -179,10 +179,10 @@ packages: dependency: transitive description: name: image_picker_android - sha256: d6a6e78821086b0b737009b09363018309bbc6de3fd88cc5c26bc2bb44a4957f + sha256: "39f2bfe497e495450c81abcd44b62f56c2a36a37a175da7d137b4454977b51b1" url: "https://pub.dev" source: hosted - version: "0.8.8+2" + version: "0.8.9+3" image_picker_for_web: dependency: transitive description: @@ -195,10 +195,10 @@ packages: dependency: transitive description: name: image_picker_ios - sha256: "76ec722aeea419d03aa915c2c96bf5b47214b053899088c9abb4086ceecf97a7" + sha256: fadafce49e8569257a0cad56d24438a6fa1f0cbd7ee0af9b631f7492818a4ca3 url: "https://pub.dev" source: hosted - version: "0.8.8+4" + version: "0.8.9+1" image_picker_linux: dependency: transitive description: @@ -219,10 +219,10 @@ packages: dependency: transitive description: name: image_picker_platform_interface - sha256: ed9b00e63977c93b0d2d2b343685bed9c324534ba5abafbb3dfbd6a780b1b514 + sha256: "3d2c323daea9d60608f1caf30be32a938916f4975434b8352e6f73dae496da38" url: "https://pub.dev" source: hosted - version: "2.9.1" + version: "2.9.4" image_picker_windows: dependency: transitive description: @@ -231,14 +231,30 @@ packages: url: "https://pub.dev" source: hosted version: "0.2.1+1" - js: + leak_tracker: + dependency: transitive + description: + name: leak_tracker + sha256: "78eb209deea09858f5269f5a5b02be4049535f568c07b275096836f01ea323fa" + url: "https://pub.dev" + source: hosted + version: "10.0.0" + leak_tracker_flutter_testing: + dependency: transitive + description: + name: leak_tracker_flutter_testing + sha256: b46c5e37c19120a8a01918cfaf293547f47269f7cb4b0058f21531c2465d6ef0 + url: "https://pub.dev" + source: hosted + version: "2.0.1" + leak_tracker_testing: dependency: transitive description: - name: js - sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3 + name: leak_tracker_testing + sha256: a597f72a664dbd293f3bfc51f9ba69816f84dcd403cdac7066cb3f6003f3ab47 url: "https://pub.dev" source: hosted - version: "0.6.7" + version: "2.0.1" lints: dependency: transitive description: @@ -251,10 +267,10 @@ packages: dependency: transitive description: name: matcher - sha256: "1803e76e6653768d64ed8ff2e1e67bea3ad4b923eb5c56a295c3e634bad5960e" + sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb url: "https://pub.dev" source: hosted - version: "0.12.16" + version: "0.12.16+1" material_buttonx: dependency: "direct main" description: @@ -267,34 +283,34 @@ packages: dependency: transitive description: name: material_color_utilities - sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41" + sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" url: "https://pub.dev" source: hosted - version: "0.5.0" + version: "0.8.0" meta: dependency: transitive description: name: meta - sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e + sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04 url: "https://pub.dev" source: hosted - version: "1.10.0" + version: "1.11.0" mime: dependency: transitive description: name: mime - sha256: e4ff8e8564c03f255408decd16e7899da1733852a9110a58fe6d1b817684a63e + sha256: "2e123074287cc9fd6c09de8336dae606d1ddb88d9ac47358826db698c176a1f2" url: "https://pub.dev" source: hosted - version: "1.0.4" + version: "1.0.5" path: dependency: transitive description: name: path - sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917" + sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" url: "https://pub.dev" source: hosted - version: "1.8.3" + version: "1.9.0" path_provider: dependency: transitive description: @@ -331,10 +347,10 @@ packages: dependency: transitive description: name: path_provider_platform_interface - sha256: "94b1e0dd80970c1ce43d5d4e050a9918fce4f4a775e6142424c30a29a363265c" + sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" url: "https://pub.dev" source: hosted - version: "2.1.1" + version: "2.1.2" path_provider_windows: dependency: transitive description: @@ -355,10 +371,10 @@ packages: dependency: transitive description: name: plugin_platform_interface - sha256: da3fdfeccc4d4ff2da8f8c556704c08f912542c5fb3cf2233ed75372384a034d + sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" url: "https://pub.dev" source: hosted - version: "2.1.6" + version: "2.1.8" sky_engine: dependency: transitive description: flutter @@ -428,14 +444,22 @@ packages: url: "https://pub.dev" source: hosted version: "2.1.4" + vm_service: + dependency: transitive + description: + name: vm_service + sha256: b3d56ff4341b8f182b96aceb2fa20e3dcb336b9f867bc0eafc0de10f1048e957 + url: "https://pub.dev" + source: hosted + version: "13.0.0" web: dependency: transitive description: name: web - sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152 + sha256: "1d9158c616048c38f712a6646e317a3426da10e884447626167240d45209cbad" url: "https://pub.dev" source: hosted - version: "0.3.0" + version: "0.5.0" win32: dependency: transitive description: @@ -453,5 +477,5 @@ packages: source: hosted version: "1.0.4" sdks: - dart: ">=3.2.6 <4.0.0" - flutter: ">=3.10.0" + dart: ">=3.3.0 <4.0.0" + flutter: ">=3.19.0" diff --git a/lib/src/audio.dart b/lib/src/audio.dart index 8a5d831..9c3ce84 100644 --- a/lib/src/audio.dart +++ b/lib/src/audio.dart @@ -1,10 +1,7 @@ -import 'dart:io'; - import 'package:chat_gpt_sdk/src/model/audio/request/audio_request.dart'; import 'package:chat_gpt_sdk/src/model/audio/request/speech_request.dart'; import 'package:chat_gpt_sdk/src/model/cancel/cancel_data.dart'; import 'package:chat_gpt_sdk/src/utils/constants.dart'; -import 'package:path_provider/path_provider.dart'; import 'client/client.dart'; import 'model/audio/response/audio_response.dart'; @@ -44,23 +41,15 @@ class Audio { ///Generates audio from the input text. /// [createSpeech] - Future createSpeech({ + Future> createSpeech({ required SpeechRequest request, - String? savePath, - String? fileName, void Function(CancelData cancelData)? onCancel, }) async { return _client.postRawBody( _client.apiUrl + kCreateSpeech, request.toJson(), onSuccess: (it, fileExtension) async { - final path = savePath ?? (await getApplicationCacheDirectory()).path; - final name = fileName ?? DateTime.now().toIso8601String(); - final mFile = File(path + "/" + name + ".$fileExtension"); - - mFile.writeAsBytes(it, mode: FileMode.write); - - return mFile; + return it; }, onCancel: (it) => onCancel != null ? onCancel(it) : null, ); diff --git a/lib/src/model/run/response/create_run_response.dart b/lib/src/model/run/response/create_run_response.dart index e880d64..4f4287f 100644 --- a/lib/src/model/run/response/create_run_response.dart +++ b/lib/src/model/run/response/create_run_response.dart @@ -55,7 +55,7 @@ class CreateRunResponse { tools: json["tools"] == null ? [] : List.from(json["tools"].map((x) => Tool.fromJson(x))), - completedAt: json["completed_at"] ?? '', + completedAt: json["completed_at"] ?? 0, threadId: json["thread_id"] ?? '', fileIds: json["file_ids"] == null ? [] diff --git a/pubspec.yaml b/pubspec.yaml index 5236e83..7119001 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.1 +version: 3.0.2 homepage: https://www.facebook.com/REDEVRX repository: https://github.com/redevRx/Flutter-ChatGPT diff --git a/test/model/audio/request/audio_request_test.dart b/test/model/audio/request/audio_request_test.dart index 6972c63..917a5dd 100644 --- a/test/model/audio/request/audio_request_test.dart +++ b/test/model/audio/request/audio_request_test.dart @@ -1,5 +1,4 @@ import 'package:chat_gpt_sdk/chat_gpt_sdk.dart'; -import 'package:chat_gpt_sdk/src/model/audio/enum/audio_format.dart'; import 'package:dio/dio.dart'; import 'package:test/test.dart';