-
Notifications
You must be signed in to change notification settings - Fork 270
Open
Description
I am trying to use openai-go SDK . i tried running simple example mentioned in docs https://developers.openai.com/api/docs/quickstart?language=golang#install-the-openai-sdk-and-run-an-api-call and it didn't run .
cmd/aicli/main.go:36:59: undefined: openai.ResponseNewParams- my code
package main
import (
"context"
"fmt"
"github.com/openai/openai-go/v3"
"github.com/openai/openai-go/v3/option"
"github.com/openai/openai-go/v3/responses"
)
func main() {
client := openai.NewClient(
option.WithAPIKey("OPENAI_API_KEY"),
)
resp, err := client.Responses.New(context.TODO(), openai.ResponseNewParams{
Model: "gpt-5.2",
Input: responses.ResponseNewParamsInputUnion{OfString: openai.String("Say this is a test")},
})
if err != nil {
panic(err.Error())
}
fmt.Println(resp.OutputText())
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels