- Notifications
You must be signed in to change notification settings - Fork5
Enhance Your AI Applications with ChatGPT Wrapper - Secure Email Authentication, Context Support, and All GPT Models in Golang!
License
AmarnathCJD/ChatGPT
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
ChatGPT - A Golang wrapper for the GPT model from OpenAI
ChatGPT is a wrapper for theGPT
model from OpenAI purely built on Golang. The application has various features, including asking questions and getting responses, remembering the context of the conversation, exporting the conversation to a file, and importing the conversation from a file.
The app also allows users to get the conversation history, use multiple models such asdavinci
,gpt 3
,gpt 3.5
, andgpt 4
. Other features include API Key Authentication, Customizable temperature of the model, Inbuilt Tokenizer for the model, and http/https proxy support for the client.
Here are some notable features of the wrapper:
- Authenticate using the API Key, which can be obtained from theOpenAI Dashboard.
- Authenticate using the
access_token
oremail/password
. - Cache the authentication token for future use.
- Multiple Accounts support, with same cache file.
- Remember the context of the conversation.
- Export the conversation to a file.
- Get the conversation history.
- Models:
davinci
,gpt 3
,gpt 3.5
,gpt 4
. - API Key Authentication.
- Customizable temperature of the model.
- Inbuilt Tokenizer for the model.
- https Proxy support for the client.
- Support for streaming the response via a channel.
Below are some things that need to be added to the application:
- Implement the
internet plugin
for theGPT
model. - Add support for the
top_p
parameter.
You can find the complete documentation for theCHATGPT
package atGoDoc
You can install ChatGPT by running the following command on your terminal:
go get github.com/amarnathcjd/chatgpt
Or usking gopkg.in:
go get gopkg.in/chatgpt.v1
Here is an example of how to use ChatGPT package:
package chatgptimport ("fmt""context""github.com/amarnathcjd/chatgpt")funcmain() {client:=chatgpt.NewClient(&chatgpt.Config{Email:"email@domain.com",Password:"password",// or ApiKey: "sk-xxxxxxxxxxxx", })iferr:=client.Start();err!=nil {panic(err) }ask,err:=client.Ask(context.Background(),"Hello, nice to meet you")iferr!=nil {panic(err) }fmt.Println("ChatGPT: ",ask.Message)}
More examples can be found in theexamples folder.
ChatGPT is released under the terms of the GPT-3 License. SeeLICENSE for more information or seeThe GPT-3 License.
About
Enhance Your AI Applications with ChatGPT Wrapper - Secure Email Authentication, Context Support, and All GPT Models in Golang!