chat_gpt_flutter 1.0.16 copy "chat_gpt_flutter: ^1.0.16" to clipboard
chat_gpt_flutter: ^1.0.16 copied to clipboard

Integration of OpenAI API using Flutter framework, ChatGPT and more

ChatGPT API implemented in Flutter

Buy Me A Coffee

Usage example

Getting started #

You have to create OpenAI account and request API key from here: https://beta.openai.com/account/api-keys

Stream usage #


final chatGpt = ChatGpt(apiKey: apiKey);

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

final request = CompletionRequest(
  prompt: question,
  stream: true,
  maxTokens: 4000,
  model: ChatGptModel.textDavinci003.key,
);

final stream = await chatGpt.createCompletionStream(request);

Usage without stream #


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);

38
likes
130
pub points
93%
popularity

Publisher

unverified uploader

Integration of OpenAI API using Flutter framework, ChatGPT and more

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

dio, flutter, http, json_annotation, json_serializable, pretty_dio_logger

More

Packages that depend on chat_gpt_flutter