Skip to content

Commit 216e1ae

Browse files
authored
Update README.md
1 parent 24f4e34 commit 216e1ae

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
11
# PHP-ChatGPT (OpenAI) connection
22
The `index.php` is a simple .php file to connect to OpenAi's API and prompt a text request using `cUrl()`. <br>
33
OPTIONAL: You can use the `ChatGPT.php` class to create both **image** and **text** request with the help of OpenAi's API. More details in comments. <br>
4-
Enjoy!
4+
5+
*This is the simplest and beginner-friendly method to connect to ChatGPT API without any need of library*
56

67
## API_KEY:
78
Generate an API KEY from https://beta.openai.com/account/api-keys and paste into the code.
89

910

10-
## Prompt
11+
## Optional Parameters
1112
Modify the prompt to fit your own needs.
12-
13+
You can add optional parameters to the class object function calls:
14+
* `echo $ai->createTextRequest("What's the best job?", 'text-davinci-003', 0.9, 300); // prompt, model, temperature, max_tokens`
15+
* `echo $ai->generateImage("Frog on a frozen lake", '1080x1080', 2); // prompt, imageSize, numberOfImages`

0 commit comments

Comments
 (0)