将文本向量化 报错,请帮忙修正
- Dominant language
- Go
- Stars
- 13k
- Forks
- 1.1k
- Avg merge
- 4h 6m
- Merged PRs (30d)
- 41
Description
**Describe the bug**
将文本向量化报错,请帮忙修正
使用模型doubao-embedding-vision-250615 或 doubao-embedding-vision-251215 报这个错
[Ark] CreateEmbeddings error: Error code: 400 - {"code":"InvalidParameter","message":"The parameter `model` specified in the request are not valid: the requested model doubao-embedding-vision-250615 does not support this api.. Request id: 0217820909878407d66892265258d8a5511543a67713e2f5b64ad","param":"model","type":"BadRequest","request_id":"202606220916280000403B365898AEEF6B"}
使用模型doubao-embedding-large-text-25051 报这个错
使用模型
[Ark] CreateEmbeddings error: Error code: 404 - {"code":"InvalidEndpointOrModel.NotFound","message":"The model or endpoint doubao-embedding-large-text-250515 does not exist or you do not have access to it. Request id: 0217820910996165899493ffacda83a911dd5c9cf3f5ba8f72592","param":"","type":"Not Found","request_id":""}
这些模型我都已开通
我问了火山引擎工单客服, 回答让问问社区
代码如下
package main
import (
"context"
"fmt"
"os"
"github.com/cloudwego/eino-ext/components/embedding/ark"
"github.com/joho/godotenv"
)
func main() {
err := godotenv.Load("../.env")
if err != nil {
panic(err)
}
ctx := context.Background()
fmt.Println(os.Getenv("EMBEDDER"))
embedder, err := ark.NewEmbedder(ctx, &ark.EmbeddingConfig{
APIKey: os.Getenv("ARK_API_KEY"),
Model: os.Getenv("EMBEDDER"),
Region: "cn-beijing",
//BaseURL: "https://ark.cn-beijing.volces.com/api/v3/embeddings/multimodal",
BaseURL: "https://ark.cn-beijing.volces.com/api/v3",
})
if err != nil {
panic(err)
}
input := []string{
"hello,hello",
}
embeddings, err := embedder.EmbedStrings(ctx, input)
if err != nil {
panic(err)
}
fmt.Println(embeddings)
}
go.mod 如下
module awesome-eino
go 1.23.0
require (
github.com/cloudwego/eino v0.9.9
github.com/cloudwego/eino-ext/components/embedding/ark v0.1.2
github.com/cloudwego/eino-ext/components/model/ark v0.1.68
github.com/joho/godotenv v1.5.1
)
require (
github.com/bahlo/generic-list-go v0.2.0 // indirect
github.com/buger/jsonparser v1.1.1 // indirect
github.com/bytedance/gopkg v0.1.3 // indirect
github.com/bytedance/sonic v1.15.0 // indirect
github.com/bytedance/sonic/loader v0.5.0 // indirect
github.com/cloudwego/base64x v0.1.6 // indirect
github.com/dustin/go-humanize v1.0.1 // indirect
github.com/eino-contrib/jsonschema v1.0.3 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/goph/emperror v0.17.2 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/json-iterator/go v1.1.12 // indirect
github.com/klauspost/cpuid/v2 v2.2.9 // indirect
github.com/mailru/easyjson v0.7.7 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nikolalohinski/gonja v1.5.3 // indirect
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/slongfield/pyfmt v0.0.0-20220222012616-ea85ff4c361f // indirect
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
github.com/volcengine/volc-sdk-golang v1.0.23 // indirect
github.com/volcengine/volcengine-go-sdk v1.2.30 // indirect
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
github.com/yargevad/filepathx v1.0.0 // indirect
golang.org/x/arch v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230713183714-613f0c0eb8a1 // indirect
golang.org/x/sync v0.16.0 // indirect
golang.org/x/sys v0.33.0 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Contributor guide
Research direction
Reproduce the failure from the provided Go example, starting at ark.NewEmbedder and EmbedStrings with the versions listed in go.mod. Inspect the embedding component's endpoint and model handling, then compare the two reported Ark configurations. Done means the supported configuration is verified for these models or the incompatibility is clearly identified and covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100