-
Notifications
You must be signed in to change notification settings - Fork 594
Closed
Labels
Description
Describe the bug
When using OpenAI embedding models, I get an error when executing:
POST "https://api.openai.com/v1/embeddings": 400 Bad Request {
"message": "invalid model ID",
"type": "invalid_request_error",
"param": null,
"code": null
}
To Reproduce
package main
import (
"context"
"log"
"github.com/firebase/genkit/go/ai"
"github.com/firebase/genkit/go/genkit"
"github.com/firebase/genkit/go/plugins/compat_oai/openai"
)
func main() {
ctx := context.Background()
oai := &openai.OpenAI{}
gk := genkit.Init(ctx, genkit.WithPlugins(oai))
em := oai.Embedder(gk, "openai/text-embedding-3-small")
if em == nil {
log.Fatal("failed to create embedder")
}
dc := ai.DocumentFromText("hello", nil)
er := &ai.EmbedRequest{
Input: []*ai.Document{dc},
Options: nil,
}
rp, err := em.Embed(ctx, er)
if err != nil {
log.Fatal(err)
}
log.Printf("%+v", rp)
}
Expected behavior
Successful embedding
Runtime (please complete the following information):
- OS: MacOS
- Version 15.6.1
** Go version
go version go1.25.0 darwin/arm64
Additional context
Add any other context about the problem here.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done