chatgpt_api_client 1.0.4 chatgpt_api_client: ^1.0.4 copied to clipboard
the chatgpt api client base on openai api , you can use your own apikey to ask chatgpt questions
ChatGpt Api client #
you can request the chatgpt by the openai api
more detail about the openai api: comletions
Features #
- ask questions to ChatGpt
- full model options supports , parameters detail: comletions
- propmt support
- normal request and stream request support
Getting started #
TODO: List prerequisites and provide or point to information on how to start using the package.
Usage #
the full example you can see the ./example
/// init instance with the model options
ChatGptApiClient client =
ChatGptApiClient(api_key, ChatGptModelOption(stream: false));
/// send message to chatgpt
client.sendMessage(text,
onData: (ChatGptApiResponse response) {
print(response);
},
onStreamData: (ChatGptApiResponse response) {
print(response);
},
onStreamEnd: () {
print('end');
});
Additional information #
If you have any questions, you can directly raise the issue