...
1 package chromem
2
3 const (
4 baseURLMistral = "https://api.mistral.ai/v1"
5
6 embeddingModelMistral = "mistral-embed"
7 )
8
9
10
11 func NewEmbeddingFuncMistral(apiKey string) EmbeddingFunc {
12
13
14 normalized := true
15
16
17
18 return NewEmbeddingFuncOpenAICompat(baseURLMistral, apiKey, embeddingModelMistral, &normalized)
19 }
20
21 const baseURLJina = "https://api.jina.ai/v1"
22
23 type EmbeddingModelJina string
24
25 const (
26 EmbeddingModelJina2BaseEN EmbeddingModelJina = "jina-embeddings-v2-base-en"
27 EmbeddingModelJina2BaseDE EmbeddingModelJina = "jina-embeddings-v2-base-de"
28 EmbeddingModelJina2BaseCode EmbeddingModelJina = "jina-embeddings-v2-base-code"
29 EmbeddingModelJina2BaseZH EmbeddingModelJina = "jina-embeddings-v2-base-zh"
30 )
31
32
33
34 func NewEmbeddingFuncJina(apiKey string, model EmbeddingModelJina) EmbeddingFunc {
35 return NewEmbeddingFuncOpenAICompat(baseURLJina, apiKey, string(model), nil)
36 }
37
38 const baseURLMixedbread = "https://api.mixedbread.ai"
39
40 type EmbeddingModelMixedbread string
41
42 const (
43 EmbeddingModelMixedbreadUAELargeV1 EmbeddingModelMixedbread = "UAE-Large-V1"
44 EmbeddingModelMixedbreadBGELargeENV15 EmbeddingModelMixedbread = "bge-large-en-v1.5"
45 EmbeddingModelMixedbreadGTELarge EmbeddingModelMixedbread = "gte-large"
46 EmbeddingModelMixedbreadE5LargeV2 EmbeddingModelMixedbread = "e5-large-v2"
47 EmbeddingModelMixedbreadMultilingualE5Large EmbeddingModelMixedbread = "multilingual-e5-large"
48 EmbeddingModelMixedbreadMultilingualE5Base EmbeddingModelMixedbread = "multilingual-e5-base"
49 EmbeddingModelMixedbreadAllMiniLML6V2 EmbeddingModelMixedbread = "all-MiniLM-L6-v2"
50 EmbeddingModelMixedbreadGTELargeZh EmbeddingModelMixedbread = "gte-large-zh"
51 )
52
53
54
55 func NewEmbeddingFuncMixedbread(apiKey string, model EmbeddingModelMixedbread) EmbeddingFunc {
56 return NewEmbeddingFuncOpenAICompat(baseURLMixedbread, apiKey, string(model), nil)
57 }
58
59 const baseURLLocalAI = "http://localhost:8080/v1"
60
61
62
63
64
65
66
67
68
69
70 func NewEmbeddingFuncLocalAI(model string) EmbeddingFunc {
71 return NewEmbeddingFuncOpenAICompat(baseURLLocalAI, "", model, nil)
72 }
73
74 const (
75 azureDefaultAPIVersion = "2024-02-01"
76 )
77
78
79
80
81
82 func NewEmbeddingFuncAzureOpenAI(apiKey string, deploymentURL string, apiVersion string, model string) EmbeddingFunc {
83 if apiVersion == "" {
84 apiVersion = azureDefaultAPIVersion
85 }
86 return newEmbeddingFuncOpenAICompat(deploymentURL, apiKey, model, nil, map[string]string{"api-key": apiKey}, map[string]string{"api-version": apiVersion})
87 }
88
View as plain text