搜尋套件、儲存庫與 APP 分類

GitHub 儲存庫leo-elstin/chat_gpt

chat_gpt

用 Dart 語言撰寫的適用於 Flutter 應用的 ChatGPT SDK

chat_gpt 專案封面
星標
6
分支
6
最近推送(UTC)
2023年10月22日
專案狀態
未封存

原始 README

以下為英文專案原文快照,最新內容請造訪 GitHub。

ChatGPT SDK for Flutter

The chatGPT SDK written in dart to access the features of the OpenAI APIs

Features

  1. Text Completion
  2. Chat Completion
  3. Code Generation
  4. Image Generation

Getting started

chat_gpt: 2.0.0
flutter pub get

Usage

Create an instance of the ChatGPT

final chatGpt = ChatGPT.builder( token: '<token>');

You can generate the token from https://beta.openai.com/account/api-keys

Additional information

#Text Completion : The completions endpoint can be used for a wide variety of tasks. More details : https://beta.openai.com/docs/guides/completion

How to write the prompts https://beta.openai.com/docs/guides/completion/prompt-design

Method to do code completion / code completion

    const prompt = "Explain Quantum Computing in simple terms";

    Completion? completion = await chatGpt.textCompletion(
      request: const CompletionRequest(
        prompt: prompt,
        maxTokens: 256,
      ),
    );

    print(completion?.choices);

#Image generation : The image generations endpoint allows you to create an original image given a text prompt. More Details : https://beta.openai.com/docs/guides/images/introduction

Supported Image Generation Types

  1. Creating images from scratch based on a text prompt
  2. Creating edits of an existing image based on a new text prompt
  3. Creating variations of an existing image

Sample Code to generate the image

    Images? images = await chatGpt.generateImage(
      request: const ImageRequest(
        prompt: 'A cute baby sea otter',
      ),
    );

    print(images?.data);

Catch me up on LinkedIn @Leo Elstin

💙 to Code 👨 🏽‍💻 Full Stack Mobile Developer [ Flutter, Native, Spring Boot ]

Leo Elstin GitHub avatar
GitHub 作者

Leo Elstin ↗

Senior Mobile Engineer @Maersk-Global

@maersk-globalBangalore, India官方網站 ↗
語言Dart

分類

此儲存庫發佈的套件

使用的依賴

依賴清單 2 項

如何選擇適合專案的儲存庫?

先依使用情境篩選,再比較專案活躍情況,最後到原始儲存庫確認使用要求。

  1. 透過儲存庫名稱、作者或描述搜尋,再依技術分類縮小範圍。
  2. 綜合星標、分支與最近推送比較專案;星標反映社群關注,不保證品質。
  3. 使用前在 GitHub 確認 README、授權條款與 Issues。

來源與維護

“A repository is the most basic element of GitHub.”

GitHub Docs — About repositories ↗