Skip to content
pubscout

chat_gpt_flutter

1.0.16, released 3 years ago by mahalox.com

Integration of OpenAI API using Flutter framework, ChatGPT and more

WASM-ready
$ flutter pub add chat_gpt_flutter
Source repository

What it does

Integrates the OpenAI API into Flutter applications. It supports completions, streams, image generation, and transcriptions.

AI-written summary of version 1.0.16, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to integrate OpenAI ChatGPT or completions in a Flutter app
  • You want support for streaming responses from OpenAI models

Skip it when

  • You are using on-device models instead of hosted cloud APIs
  • You require backend features outside of OpenAI's API scope

Strengths

  • Supports streaming and non-streaming responses
  • Includes support for multiple models including custom fine-tuned ones and image generation endpoints

Weaknesses

  • Depends on external OpenAI services
  • Not documented beyond basic API usage in README

Setup

Kind
Flutter widgets
Effort
Low
Code generation
Yes (build_runner)
Direct dependencies
5

Requires creating an OpenAI account and obtaining an API key.

final chatGpt = ChatGpt(apiKey: apiKey);

final testPrompt =
    'Which Disney character famously leaves a glass slipper behind at a royal ball?';

final testRequest = CompletionRequest(
  prompt: testPrompt,
  model: ChatGptModel.textDavinci003.key,
);

final result = await chatGpt.createCompletion(testRequest);

Alternatives

Packages that do the same job and could replace chat_gpt_flutter.

Works with

Packages commonly used together with chat_gpt_flutter: ones it builds on, ones built on it, and its own family.