Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/docs/ai/llm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ For text embedding, a spec for OpenAI looks like this:
cocoindex.functions.EmbedText(
api_type=cocoindex.LlmApiType.OPENAI,
model="text-embedding-3-small",
# Optional, use the default output dimension if not specified
output_dimension=1536,
)
```

Expand Down Expand Up @@ -199,7 +201,10 @@ For text embedding, a spec looks like this:
cocoindex.functions.EmbedText(
api_type=cocoindex.LlmApiType.GEMINI,
model="text-embedding-004",
# Optional, use the default task type if not specified
task_type="SEMANTICS_SIMILARITY",
# Optional, use the default output dimension if not specified
output_dimension=1536,
)
```

Expand Down Expand Up @@ -260,7 +265,10 @@ For text embedding, a spec for Vertex AI looks like this:
cocoindex.functions.EmbedText(
api_type=cocoindex.LlmApiType.VERTEX_AI,
model="text-embedding-005",
# Optional, use the default task type if not specified
task_type="SEMANTICS_SIMILARITY",
# Optional, use the default output dimension if not specified
output_dimension=1536,
api_config=cocoindex.llm.VertexAiConfig(project="your-project-id"),
)
```
Expand Down