From d60f4dd0fe0dd0c2ba044da70b5d39c39a0f9b23 Mon Sep 17 00:00:00 2001 From: Gwhyyy Date: Wed, 8 Mar 2023 18:53:07 +0100 Subject: [PATCH] [ Fix ] fixed analyser type issue, edited documentation --- README.md | 4 ++-- lib/src/core/models/completion/stream/sub_models/choices.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 30c59f5b..88d7b505 100644 --- a/README.md +++ b/README.md @@ -227,7 +227,7 @@ OpenAIChatCompletionModel chatCompletion = await OpenAI.instance.chat.create( in addition to calling `OpenAI.instance.chat.create()` which is a `Future` and will resolve only after the whole chat is generated, you can get a `Stream` of results: ```dart - OpenAIStreamChatCompletionModel chatStream = OpenAI.instance.chat.createStream( +OpenAIStreamChatCompletionModel chatStream = OpenAI.instance.chat.createStream( model: "gpt-3.5-turbo", messages: [ OpenAIChatCompletionChoiceMessageModel( @@ -237,7 +237,7 @@ in addition to calling `OpenAI.instance.chat.create()` which is a `Future` and w ], ); - chatStream.listen((chatStreamEvent) { +chatStream.listen((chatStreamEvent) { print(chatStreamEvent); // ... }) ``` diff --git a/lib/src/core/models/completion/stream/sub_models/choices.dart b/lib/src/core/models/completion/stream/sub_models/choices.dart index 5feb2028..0d780411 100644 --- a/lib/src/core/models/completion/stream/sub_models/choices.dart +++ b/lib/src/core/models/completion/stream/sub_models/choices.dart @@ -12,7 +12,7 @@ class OpenAIStreamCompletionModelChoice { final int? logprobs; /// The reason the completion finished. - final finishReason; + final String finishReason; @override int get hashCode { diff --git a/pubspec.yaml b/pubspec.yaml index ec6e3f2e..4227ac53 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dart_openai description: Dart SDK for openAI Apis (GPT-3 & DALL-E), integrate easily the power of OpenAI's state-of-the-art AI models into their Dart applications. -version: 1.6.1 +version: 1.6.2 homepage: https://github.com/anasfik/openai repository: https://github.com/anasfik/openai documentation: https://github.com/anasfik/openai/blob/main/README.md