@@ -54,18 +54,26 @@ class ProximityPrecision(str, Enum):
5454 BY_ATTRIBUTE = "byAttribute"
5555
5656
57+ class EmbedderDistribution (CamelBase ):
58+ mean : float
59+ sigma : float
60+
61+
5762class LocalizedAttributes (CamelBase ):
5863 attribute_patterns : List [str ]
5964 locales : List [str ]
6065
6166
6267class OpenAiEmbedder (CamelBase ):
6368 source : str = "openAi"
69+ url : Optional [str ] = None
6470 model : Optional [str ] = None # Defaults to text-embedding-3-small
6571 dimensions : Optional [int ] = None # Uses the model default
6672 api_key : Optional [str ] = None # Can be provided through a CLI option or environment variable
6773 document_template : Optional [str ] = None
6874 document_template_max_bytes : Optional [int ] = None # Default to 400
75+ distribution : Optional [EmbedderDistribution ] = None
76+ binary_quantized : Optional [bool ] = None
6977
7078
7179class HuggingFaceEmbedder (CamelBase ):
@@ -74,12 +82,45 @@ class HuggingFaceEmbedder(CamelBase):
7482 revision : Optional [str ] = None
7583 document_template : Optional [str ] = None
7684 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
77111
78112
79113class UserProvidedEmbedder (CamelBase ):
80114 source : str = "userProvided"
81115 dimensions : int
116+ distribution : Optional [EmbedderDistribution ] = None
117+ binary_quantized : Optional [bool ] = None
82118
83119
84120class 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