@@ -107,6 +107,8 @@ For text embedding, a spec for OpenAI looks like this:
107107cocoindex.functions.EmbedText(
108108 api_type = cocoindex.LlmApiType.OPENAI ,
109109 model = " text-embedding-3-small" ,
110+ # Optional, use the default output dimension if not specified
111+ output_dimension = 1536 ,
110112)
111113```
112114
@@ -199,7 +201,10 @@ For text embedding, a spec looks like this:
199201cocoindex.functions.EmbedText(
200202 api_type = cocoindex.LlmApiType.GEMINI ,
201203 model = " text-embedding-004" ,
204+ # Optional, use the default task type if not specified
202205 task_type = " SEMANTICS_SIMILARITY" ,
206+ # Optional, use the default output dimension if not specified
207+ output_dimension = 1536 ,
203208)
204209```
205210
@@ -260,7 +265,10 @@ For text embedding, a spec for Vertex AI looks like this:
260265cocoindex.functions.EmbedText(
261266 api_type = cocoindex.LlmApiType.VERTEX_AI ,
262267 model = " text-embedding-005" ,
268+ # Optional, use the default task type if not specified
263269 task_type = " SEMANTICS_SIMILARITY" ,
270+ # Optional, use the default output dimension if not specified
271+ output_dimension = 1536 ,
264272 api_config = cocoindex.llm.VertexAiConfig(project = " your-project-id" ),
265273)
266274```
0 commit comments