chat_gpt_api

Creator: coderz1093

Last updated:

0 purchases

chat_gpt_api Image
chat_gpt_api Images

Languages

Categories

Add to Cart

Description:

chat gpt api

ChatGPT SDK for Flutter #
The chatGPT SDK written in dart to access the features of the OpenAI APIs
Features #

Text Completion
Chat Completion
Code Generation
Image Generation

Getting started #
chat_gpt: 2.0.0
flutter pub get
copied to clipboard
Usage #
Create an instance of the ChatGPT
final chatGpt = ChatGPT.builder( token: '<token>');
copied to clipboard
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);
copied to clipboard
#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

Creating images from scratch based on a text prompt
Creating edits of an existing image based on a new text prompt
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);
copied to clipboard
Catch me up on LinkedIn @Leo Elstin
💙 to Code 👨 🏽‍💻 Full Stack Mobile Developer [ Flutter, Native, Spring Boot ]

License

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

Files In This Product:

Customer Reviews

There are no reviews.