@@ -54,18 +54,26 @@ class ProximityPrecision(str, Enum):
54
54
BY_ATTRIBUTE = "byAttribute"
55
55
56
56
57
+ class EmbedderDistribution (CamelBase ):
58
+ mean : float
59
+ sigma : float
60
+
61
+
57
62
class LocalizedAttributes (CamelBase ):
58
63
attribute_patterns : List [str ]
59
64
locales : List [str ]
60
65
61
66
62
67
class OpenAiEmbedder (CamelBase ):
63
68
source : str = "openAi"
69
+ url : Optional [str ] = None
64
70
model : Optional [str ] = None # Defaults to text-embedding-3-small
65
71
dimensions : Optional [int ] = None # Uses the model default
66
72
api_key : Optional [str ] = None # Can be provided through a CLI option or environment variable
67
73
document_template : Optional [str ] = None
68
74
document_template_max_bytes : Optional [int ] = None # Default to 400
75
+ distribution : Optional [EmbedderDistribution ] = None
76
+ binary_quantized : Optional [bool ] = None
69
77
70
78
71
79
class HuggingFaceEmbedder (CamelBase ):
@@ -74,12 +82,45 @@ class HuggingFaceEmbedder(CamelBase):
74
82
revision : Optional [str ] = None
75
83
document_template : Optional [str ] = None
76
84
document_template_max_bytes : Optional [int ] = None # Default to 400
85
+ distribution : Optional [EmbedderDistribution ] = None
86
+ binary_quantized : Optional [bool ] = None
87
+
88
+
89
+ class OllamaEmbedder (CamelBase ):
90
+ source : str = "ollama"
91
+ url : Optional [str ] = None
92
+ api_key : Optional [str ] = None
93
+ model : str
94
+ document_template : Optional [str ] = None
95
+ document_template_max_bytes : Optional [int ] = None # Default to 400
96
+ distribution : Optional [EmbedderDistribution ] = None
97
+ binary_quantized : Optional [bool ] = None
98
+
99
+
100
+ class RestEmbedder (CamelBase ):
101
+ source : str = "rest"
102
+ url : str
103
+ api_key : Optional [str ] # required for protected APIs
104
+ document_template : Optional [str ] = None
105
+ document_template_max_bytes : Optional [int ] = None # Default to 400
106
+ request : Dict [str , Any ]
107
+ response : Dict [str , Any ]
108
+ distribution : Optional [EmbedderDistribution ] = None
109
+ headers : Optional [Dict [str , Any ]] = None
110
+ binary_quantized : Optional [bool ] = None
77
111
78
112
79
113
class UserProvidedEmbedder (CamelBase ):
80
114
source : str = "userProvided"
81
115
dimensions : int
116
+ distribution : Optional [EmbedderDistribution ] = None
117
+ binary_quantized : Optional [bool ] = None
82
118
83
119
84
120
class Embedders (CamelBase ):
85
- embedders : Dict [str , Union [OpenAiEmbedder , HuggingFaceEmbedder , UserProvidedEmbedder ]]
121
+ embedders : Dict [
122
+ str ,
123
+ Union [
124
+ OpenAiEmbedder , HuggingFaceEmbedder , OllamaEmbedder , RestEmbedder , UserProvidedEmbedder
125
+ ],
126
+ ]
0 commit comments