@@ -107,6 +107,8 @@ For text embedding, a spec for OpenAI looks like this:
107
107
cocoindex.functions.EmbedText(
108
108
api_type = cocoindex.LlmApiType.OPENAI ,
109
109
model = " text-embedding-3-small" ,
110
+ # Optional, use the default output dimension if not specified
111
+ output_dimension = 1536 ,
110
112
)
111
113
```
112
114
@@ -199,7 +201,10 @@ For text embedding, a spec looks like this:
199
201
cocoindex.functions.EmbedText(
200
202
api_type = cocoindex.LlmApiType.GEMINI ,
201
203
model = " text-embedding-004" ,
204
+ # Optional, use the default task type if not specified
202
205
task_type = " SEMANTICS_SIMILARITY" ,
206
+ # Optional, use the default output dimension if not specified
207
+ output_dimension = 1536 ,
203
208
)
204
209
```
205
210
@@ -260,7 +265,10 @@ For text embedding, a spec for Vertex AI looks like this:
260
265
cocoindex.functions.EmbedText(
261
266
api_type = cocoindex.LlmApiType.VERTEX_AI ,
262
267
model = " text-embedding-005" ,
268
+ # Optional, use the default task type if not specified
263
269
task_type = " SEMANTICS_SIMILARITY" ,
270
+ # Optional, use the default output dimension if not specified
271
+ output_dimension = 1536 ,
264
272
api_config = cocoindex.llm.VertexAiConfig(project = " your-project-id" ),
265
273
)
266
274
```
0 commit comments