Skip to content

Latest commit

 

History

History
26 lines (19 loc) · 401 Bytes

README.md

File metadata and controls

26 lines (19 loc) · 401 Bytes

GOAI

Go OpenAI API Library

go get github.com/seemywingz/goai

// main.go
package main

import (
	"os"

	"github.com/seemywingz/goai"
)

func main() {
	oai := goai.NewClient(os.Getenv("OPENAI_API_KEY"), false)
	oaiRes, err := oai.TextCompletion("This is a test.")
	if err != nil {
		panic(err)
	}
	println(oaiRes.Choices[0].Text)
}