Skip to content

OpenAI (ChatGPT) API Client for Go

License

Notifications You must be signed in to change notification settings

doytsujin/openaigo

This branch is 85 commits behind otiai10/openaigo:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Dec 10, 2022
27e7c7f · Dec 10, 2022

History

15 Commits
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022
Dec 10, 2022

Repository files navigation

openaigo

Go CodeQL App Test over API FOSSA Status

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_APIKEY"))
  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 [email protected]:otiai10/openaigo.git
cd openaigo
OPENAI_APIKEY=YourAPIKey go run ./testapp/main.go

Endpoint Support

About

OpenAI (ChatGPT) API Client for Go

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%