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

Libraries

chatgpt_api_client