Skip to content

reallyli/openaigo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openaigo

Go CodeQL App Test over API
License FOSSA Status Maintainability Go Report Card codecov Reference

Yet another API client for api.openai.com.

This library is community-maintained, NOT officially supported by OpenAI.

Usage Example

package main

import (
  "fmt"
  "github.com/otiai10/openaigo"
)

func main() {
  client := openaigo.NewClient(os.Getenv("OPENAI_API_KEY"))
  request := openaigo.CompletionRequestBody{
    Model:  "text-davinci-003",
    Prompt: []string{"Say this is a test"},
  }
  response, err := client.Completion(nil, request)
  fmt.Println(response, err)
}

if you just want to try, hit commands below.

git clone git@github.com:otiai10/openaigo.git
cd openaigo
OPENAI_API_KEY=YourAPIKey go run ./testapp/main.go

Endpoint Support

Issues

Report any issue here or any feedback is welcomed.

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%