chat_gpt_flutter

Creator: coderz1093

Last updated:

0 purchases

chat_gpt_flutter Image
chat_gpt_flutter Images

Languages

Categories

Add to Cart

Description:

chat gpt flutter

ChatGPT API implemented in Flutter


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

copied to clipboard
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);

copied to clipboard

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.