From 9295e9704fb66ba2f28ffe5d225cf23cd49506de Mon Sep 17 00:00:00 2001 From: Manan Gandhi Date: Fri, 17 May 2024 23:16:07 +0530 Subject: [PATCH] Added comments --- CHANGELOG.md | 4 ++++ lib/src/text_generation/text_generation.dart | 9 +++------ lib/src/text_summarization/text_summarization.dart | 6 +++--- lib/src/text_to_image/text_to_image.dart | 6 +++--- pubspec.yaml | 4 ++-- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66bc6e9..f029de2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,3 +10,7 @@ - Updated pubspec.yaml with better description. - Added comments for readability. + +## 1.0.1+1 + +- Updated pubspec.yaml with better description. \ No newline at end of file diff --git a/lib/src/text_generation/text_generation.dart b/lib/src/text_generation/text_generation.dart index 37342b0..ce3a979 100644 --- a/lib/src/text_generation/text_generation.dart +++ b/lib/src/text_generation/text_generation.dart @@ -7,10 +7,9 @@ export 'models.dart'; export 'response.dart'; class TextGenerationModel { - late String accountId; - late String apiKey; - late TextGenerationModels model; - late bool raw; + late String accountId; // Account ID, available on Cloudflare daskboard + late String apiKey; // API Key, can by generated from the Cloudflare dashboard + late TextGenerationModels model; // The model to use NetworkService networkService = NetworkService(); late String baseUrl; @@ -18,7 +17,6 @@ class TextGenerationModel { required this.accountId, required this.apiKey, required this.model, - this.raw = true, }) { baseUrl = "https://api.cloudflare.com/client/v4/accounts/$accountId/ai/run"; } @@ -28,7 +26,6 @@ class TextGenerationModel { Map res = await networkService.post("$baseUrl/${model.value}", apiKey, { "prompt": prompt, - "raw": raw, }); TextGenerationResponse response = TextGenerationResponse.fromJson(res['data']); diff --git a/lib/src/text_summarization/text_summarization.dart b/lib/src/text_summarization/text_summarization.dart index c191dc8..2047623 100644 --- a/lib/src/text_summarization/text_summarization.dart +++ b/lib/src/text_summarization/text_summarization.dart @@ -6,9 +6,9 @@ export 'models.dart'; export 'response.dart'; class TextSummarizationModel { - late String accountId; - late String apiKey; - late TextSummarizationModels model; + late String accountId; // Account ID, available on Cloudflare daskboard + late String apiKey; // API Key, can by generated from the Cloudflare dashboard + late TextSummarizationModels model; // The model to use NetworkService networkService = NetworkService(); late String baseUrl; diff --git a/lib/src/text_to_image/text_to_image.dart b/lib/src/text_to_image/text_to_image.dart index 119e903..3e04374 100644 --- a/lib/src/text_to_image/text_to_image.dart +++ b/lib/src/text_to_image/text_to_image.dart @@ -6,9 +6,9 @@ import 'models.dart'; export 'models.dart'; class TextToImageModel { - late String accountId; - late String apiKey; - late TextToImageModels model; + late String accountId; // Account ID, available on Cloudflare daskboard + late String apiKey; // API Key, can by generated from the Cloudflare dashboard + late TextToImageModels model; // The model to use NetworkService networkService = NetworkService(); late String baseUrl; diff --git a/pubspec.yaml b/pubspec.yaml index 8d1f577..c40f12f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: cloudflare_ai -description: This is a Dart package for Cloudflare Workers AI. It provides a simple Dart API to interact with Cloudflare AI. It is built on top of the Dio package. It currently supports Text Generation and Image Generation, Text Summarization, and Image Generation Models. Feel free to contribute to this project through Issues and Pull Requests. -version: 1.0.1 +description: This is a Dart package for Cloudflare Workers AI. It currently supports Text Generation and Image Generation, Text Summarization, and Image Generation Models. +version: 1.0.1+1 repository: https://github.com/MananGandhi1810/cloudflare-ai-dart environment: