mirror of
https://github.com/lancedb/lancedb.git
synced 2026-10-13 15:22:30 +00:00
The pages describing this code lived in lancedb/docs, a repository with ten stars that neither contributing guide mentioned. A user who hit a wrong page while reading the source had to find a separate, near-invisible repository to fix it. These 102 pages now sit beside the code, and a documentation fix is a pull request in the repository the reader already had open. `docs/web` is a complete Mintlify site: `cd docs/web && mint dev` serves it with no other checkout. Enterprise pages stay private and are merged in when the published site is assembled, so links into them do not resolve here — every open-source page does. `docs/web-tests` holds the tests the code examples are extracted from. They ran against a published wheel before; here they can run against this repository's own SDK, so an example that stops compiling fails the pull request that broke it rather than being noticed later. Both directories sit beside `docs/src` and are invisible to it: mkdocs reads `docs_dir: src`, so the SDK reference builds and deploys exactly as before.
26 lines
2.0 KiB
Plaintext
26 lines
2.0 KiB
Plaintext
---
|
|
title: Gemini
|
|
sidebarTitle: Gemini
|
|
---
|
|
|
|
import { PyEmbeddingGeminiUsage } from '/snippets/integrations.mdx';
|
|
|
|
With Google's Gemini, you can represent text (words, sentences, and blocks of text) in a vectorized form, making it easier to compare and contrast embeddings. For example, two texts that share a similar subject matter or sentiment should have similar embeddings, which can be identified through mathematical comparison techniques such as cosine similarity. For more on how and why you should use embeddings, refer to the Embeddings guide.
|
|
The Gemini Embedding Model API supports various task types:
|
|
|
|
| Task Type | Description |
|
|
|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
|
| "`retrieval_query`" | Specifies the given text is a query in a search/retrieval setting. |
|
|
| "`retrieval_document`" | Specifies the given text is a document in a search/retrieval setting. Using this task type requires a title but is automatically provided by Embeddings API |
|
|
| "`semantic_similarity`" | Specifies the given text will be used for Semantic Textual Similarity (STS). |
|
|
| "`classification`" | Specifies that the embeddings will be used for classification. |
|
|
| "`clustering`" | Specifies that the embeddings will be used for clustering. |
|
|
|
|
|
|
Usage Example:
|
|
|
|
<CodeGroup>
|
|
<CodeBlock filename="Python" language="Python" icon="python">
|
|
{PyEmbeddingGeminiUsage}
|
|
</CodeBlock>
|
|
</CodeGroup> |