feat(model): change env name from ARK_EMBEDDING_AK to ARK_EMBEDDING_A… (#482)
This commit is contained in:
parent
afaaadec16
commit
4b03f8de78
|
|
@ -335,6 +335,9 @@ func getEmbedding(ctx context.Context) (embedding.Embedder, error) {
|
|||
var (
|
||||
arkEmbeddingBaseURL = os.Getenv("ARK_EMBEDDING_BASE_URL")
|
||||
arkEmbeddingModel = os.Getenv("ARK_EMBEDDING_MODEL")
|
||||
arkEmbeddingApiKey = os.Getenv("ARK_EMBEDDING_API_KEY")
|
||||
// deprecated: use ARK_EMBEDDING_API_KEY instead
|
||||
// ARK_EMBEDDING_AK will be removed in the future
|
||||
arkEmbeddingAK = os.Getenv("ARK_EMBEDDING_AK")
|
||||
arkEmbeddingDims = os.Getenv("ARK_EMBEDDING_DIMS")
|
||||
)
|
||||
|
|
@ -345,7 +348,12 @@ func getEmbedding(ctx context.Context) (embedding.Embedder, error) {
|
|||
}
|
||||
|
||||
emb, err = arkemb.NewArkEmbedder(ctx, &ark.EmbeddingConfig{
|
||||
APIKey: arkEmbeddingAK,
|
||||
APIKey: func() string {
|
||||
if arkEmbeddingApiKey != "" {
|
||||
return arkEmbeddingApiKey
|
||||
}
|
||||
return arkEmbeddingAK
|
||||
}(),
|
||||
Model: arkEmbeddingModel,
|
||||
BaseURL: arkEmbeddingBaseURL,
|
||||
}, dims, batchSize)
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export OPENAI_EMBEDDING_REQUEST_DIMS=1024
|
|||
|
||||
# ark embedding
|
||||
export ARK_EMBEDDING_MODEL=""
|
||||
export ARK_EMBEDDING_AK=""
|
||||
export ARK_EMBEDDING_API_KEY=""
|
||||
export ARK_EMBEDDING_DIMS="2048"
|
||||
export ARK_EMBEDDING_BASE_URL=""
|
||||
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ export OPENAI_EMBEDDING_REQUEST_DIMS=1024
|
|||
|
||||
# ark embedding
|
||||
export ARK_EMBEDDING_MODEL=""
|
||||
export ARK_EMBEDDING_AK=""
|
||||
export ARK_EMBEDDING_API_KEY=""
|
||||
export ARK_EMBEDDING_DIMS="2048"
|
||||
export ARK_EMBEDDING_BASE_URL=""
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue