-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
76b915e
commit fde421e
Showing
1 changed file
with
48 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,49 @@ | ||
# go-gpt3 | ||
Client that connects to GTP3 Apis and provides an interface to query the APIs | ||
Package gpt3 provides access to the the GPT3 completions Api | ||
along with new beta APIs for classification, enhanced search, and question answering. | ||
|
||
Additionally, support for newer Beta Engines is added broadening the scope in which you can query the APIs from your Golang application/packages. | ||
|
||
|
||
The underlying structure is defined along a request / response interface pattern with a | ||
singular call to the client. | ||
The request is initialised as per required parameters an example being: | ||
|
||
|
||
```go | ||
req := gpt3.AnswerRequest{ | ||
Documents: []string{"Puppy A is happy.","Puppy B is sad."}, | ||
Question: "which puppy is happy?", | ||
SearchModel: gpt3.ADA, | ||
Model: gpt3.CURIE, | ||
ExamplesContext: "In 2017, U.S. life expectancy was 78.6 years.", | ||
Examples: examples, | ||
MaxTokens: 5, | ||
Stop: []string{"\n", "<|endoftext|>"}, | ||
Logprobs: 1, | ||
N: 1, | ||
} | ||
``` | ||
Full examples can be found and run at `go run internal/examples/main.go` | ||
|
||
You can alternate between the different engines through the call to `setup` on the client to switch engines on execution. | ||
|
||
```go | ||
//Initialises a client | ||
cl := gpt3.ApiClient{} | ||
//Stipulate engines to use. | ||
cl.Setup(gpt3.ADA, gpt3.DAVINCI) | ||
//Execute request | ||
response, err := cl.Call(&req) | ||
``` | ||
|
||
*** | ||
|
||
## Support | ||
- List Engines API | ||
- Completion API | ||
- Document Search API | ||
- Files List API | ||
- Answers API | ||
- Classification API | ||
- Enhanced Search API |