# chatgpt
**Repository Path**: mstitop/chatgpt
## Basic Information
- **Project Name**: chatgpt
- **Description**: No description available
- **Primary Language**: Unknown
- **License**: MIT
- **Default Branch**: master
- **Homepage**: None
- **GVP Project**: No
## Statistics
- **Stars**: 0
- **Forks**: 0
- **Created**: 2023-11-21
- **Last Updated**: 2023-11-21
## Categories & Tags
**Categories**: Uncategorized
**Tags**: chatGPT
## README
📦 ChatGPT
Realize continuous dialogue Chat GPT plug-in
[](./README_en.md)
[](./README.md)
#1. create Completion
Provides the tool class `OpenAiUtils`, which provides related methods for calling.
The simplest way to use it is:
```java
OpenAiUtils.createCompletion(prompt);
```
The input parameter `prompt` is the string of the input question.
A common static method is also provided.
```java
public static List createCompletion(CompletionRequest completionRequest) {...}
```
The input parameter `CompletionRequest` contains some adjustable parameters of the model.
There are also multiple static methods to choose from in the `OpenAiUtils` class, which can be viewed by yourself.
The return parameter of the above method is a list because the adjustment parameter returns the answer `n` to return multiple different answers at once (`n` is a parameter in the `CompletionRequest` class).
#2. Create Image
You can simply use the following code to generate some images
```java
OpenAiUtils.createImage(prompt);
```
As with `createCompletion`, some static methods are provided, which you can consult.
A common static method is also provided.
```java
public static List createImage(CreateImageRequest createImageRequest) {...}
```
#3. Download Image
use this method you can directly download the image that you describe
```java
OpenAiUtils.downloadImage(prompt, response);
```
A common static method is also provided.
```java
public static void downloadImage(CreateImageRequest createImageRequest, OutputStream os) {...}
```