Skip to content

The script is a Bash script that uses the OpenAI API to provide a conversational interface in command line.

Notifications You must be signed in to change notification settings

luizcast/chatGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

chatGPT

The script is a Bash script that interacts with the OpenAI API to provide a conversational interface. The script prompts the user to input a message, sends that message to the OpenAI API, retrieves the API's response, and displays it to the user.

The script begins by setting the OpenAI API key to a specified value, which is required to access the API. The model to be used for the conversation is also set to "text-davinci-002."

The script then enters a loop that prompts the user for input, sends that input to the OpenAI API, retrieves the API's response, and displays it to the user. The loop continues until the user exits the script.

The API request is sent using the cURL command, with the necessary headers and parameters specified. The response from the API is then processed using the jq command-line tool to extract the response text.

The script also includes error handling to check if the API request was successful and to display an error message if it was not.

Overall, the script provides a simple conversational interface using the OpenAI API and can be used for various purposes, such as chatbots, virtual assistants, and more.

About

The script is a Bash script that uses the OpenAI API to provide a conversational interface in command line.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages