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
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.
- firebase_ai
Alternative AI integration via Firebase services.
86Compare - llamadart
Alternative for running local models instead of OpenAI.
93Compare
Works with
Packages commonly used together with chat_gpt_flutter: ones it builds on, ones built on it, and its own family.
- json_annotationchat_gpt_flutter depends on itProvides annotations for json_serializable to generate JSON (de)serialization code.
- diochat_gpt_flutter depends on itA powerful HTTP networking package for Dart and Flutter with interceptors and request cancellation.
- json_serializablechat_gpt_flutter depends on itAutomatically generate code for converting Dart classes to and from JSON.
- pretty_dio_loggerchat_gpt_flutter depends on itA Dio interceptor that logs network calls in a pretty, easy to read format.