Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 416962e

Browse files
authored
docs: update LLM docs to add output_dimensions example (#1048)
1 parent f3b103a commit 416962e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎docs/docs/ai/llm.mdx‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ For text embedding, a spec for OpenAI looks like this:
107107
cocoindex.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:
199201
cocoindex.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:
260265
cocoindex.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

Comments
 (0)