Skip to content

Commit

Permalink
Update code & copy
Browse files Browse the repository at this point in the history
  • Loading branch information
databyjp committed Dec 10, 2024
1 parent d4ff379 commit 1698615
Show file tree
Hide file tree
Showing 7 changed files with 217 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,101 @@
# clean up
client.collections.delete("DemoCollection")

# START BasicMMVectorizerVoyageAI
from weaviate.classes.config import Configure

client.collections.create(
"DemoCollection",
# highlight-start
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="poster", data_type=DataType.BLOB),
],
vectorizer_config=[
Configure.NamedVectors.multi2vec_voyageai(
name="title_vector",
# Define the fields to be used for the vectorization - using image_fields, text_fields
image_fields=[
Multi2VecField(name="poster", weight=0.9)
],
text_fields=[
Multi2VecField(name="title", weight=0.1)
],
)
],
# highlight-end
# Additional parameters not shown
)
# END BasicMMVectorizerVoyageAI

# clean up
client.collections.delete("DemoCollection")

# START MMVectorizerVoyageAICustomModel
from weaviate.classes.config import Configure

client.collections.create(
"DemoCollection",
# highlight-start
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="poster", data_type=DataType.BLOB),
],
vectorizer_config=[
Configure.NamedVectors.multi2vec_voyageai(
name="title_vector",
model="voyage-multimodal-3",
# Define the fields to be used for the vectorization - using image_fields, text_fields
image_fields=[
Multi2VecField(name="poster", weight=0.9)
],
text_fields=[
Multi2VecField(name="title", weight=0.1)
],
)
],
# highlight-end
# Additional parameters not shown
)
# END MMVectorizerVoyageAICustomModel

# clean up
client.collections.delete("DemoCollection")

# START FullMMVectorizerVoyageAI
from weaviate.classes.config import Configure

client.collections.create(
"DemoCollection",
# highlight-start
properties=[
Property(name="title", data_type=DataType.TEXT),
Property(name="poster", data_type=DataType.BLOB),
],
vectorizer_config=[
Configure.NamedVectors.multi2vec_voyageai(
name="title_vector",
# Define the fields to be used for the vectorization - using image_fields, text_fields
image_fields=[
Multi2VecField(name="poster", weight=0.9)
],
text_fields=[
Multi2VecField(name="title", weight=0.1)
],
# Further options
# model="voyage-multimodal-3",
# truncate="true", # "false"
# base_url="<custom_voyageai_url>"
)
],
# highlight-end
# Additional parameters not shown
)
# END FullMMVectorizerVoyageAI

# clean up
client.collections.delete("DemoCollection")

# START BasicVectorizerWeaviate
from weaviate.classes.config import Configure

Expand Down
110 changes: 110 additions & 0 deletions developers/weaviate/model-providers/_includes/provider.vectorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1034,6 +1034,116 @@ await client.collections.create({
// Clean up
await client.collections.delete('DemoCollection');

// START BasicMMVectorizerVoyageAI
await client.collections.create({
name: "DemoCollection",
// highlight-start
properties: [
{
name: 'title',
dataType: weaviate.configure.dataType.TEXT,
},
{
name: 'poster',
dataType: weaviate.configure.dataType.BLOB,
},
],
vectorizers: [
weaviate.configure.vectorizer.multi2VecVoyageAI({
name: "title_vector",
// Define the fields to be used for the vectorization - using imageFields, textFields
imageFields: [{
name: "poster",
weight: 0.9
}],
textFields: [{
name: "title",
weight: 0.1
}]
})],
// highlight-end
// Additional parameters not shown
})
// END BasicMMVectorizerVoyageAI

// Clean up
await client.collections.delete('DemoCollection');

// START MMVectorizerVoyageAICustomModel
await client.collections.create({
name: "DemoCollection",
// highlight-start
properties: [
{
name: 'title',
dataType: weaviate.configure.dataType.TEXT,
},
{
name: 'poster',
dataType: weaviate.configure.dataType.BLOB,
},
],
vectorizers: [
weaviate.configure.vectorizer.multi2VecVoyageAI({
name: "title_vector",
model: "voyage-multimodal-3",
// Define the fields to be used for the vectorization - using imageFields, textFields
imageFields: [{
name: "poster",
weight: 0.9
}],
textFields: [{
name: "title",
weight: 0.1
}]
})],
// highlight-end
// Additional parameters not shown
})
// END MMVectorizerVoyageAICustomModel

// Clean up
await client.collections.delete('DemoCollection');

// START FullMMVectorizerVoyageAI
await client.collections.create({
name: "DemoCollection",
// highlight-start
properties: [
{
name: 'title',
dataType: weaviate.configure.dataType.TEXT,
},
{
name: 'poster',
dataType: weaviate.configure.dataType.BLOB,
},
],
vectorizers: [
weaviate.configure.vectorizer.multi2VecVoyageAI({
name: "title_vector",
// Define the fields to be used for the vectorization - using imageFields, textFields
imageFields: [{
name: "poster",
weight: 0.9
}],
textFields: [{
name: "title",
weight: 0.1
}],
// Further options
// model: "voyage-multimodal-3",
// truncate: "true", // "false"
// baseURL: "<custom_voyageai_url>"
})],
// highlight-end
// Additional parameters not shown
})
// END FullMMVectorizerVoyageAI

// Clean up
await client.collections.delete('DemoCollection');

// START BasicVectorizerWeaviate
await client.collections.create({
name: 'DemoCollection',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ The query below returns the `n` most similar objects to the input image from the

### Other integrations

- [Cohere text embeddings models + Weaviate](./embeddings.md).
- [Cohere text embedding models + Weaviate](./embeddings.md).
- [Cohere generative models + Weaviate](./generative.md).
- [Cohere reranker models + Weaviate](./reranker.md).

Expand Down
2 changes: 1 addition & 1 deletion developers/weaviate/model-providers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This enables an enhanced developed experience, such as the ability to:
| [OctoAI (Deprecated)](./octoai/index.md) | [Text](./octoai/embeddings.md) | [Text](./octoai/generative.md) | - |
| [OpenAI](./openai/index.md) | [Text](./openai/embeddings.md) | [Text](./openai/generative.md) | - |
| [Azure OpenAI](./openai-azure/index.md) | [Text](./openai-azure/embeddings.md) | [Text](./openai-azure/generative.md) | - |
| [Voyage AI](./voyageai/index.md) | [Text](./voyageai/embeddings.md) | - | [Reranker](./voyageai/reranker.md) |
| [Voyage AI](./voyageai/index.md) | [Text](./voyageai/embeddings.md), [Multimodal](./voyageai/embeddings-multimodal.md) | - | [Reranker](./voyageai/reranker.md) |
| [Weaviate](./weaviate/index.md) | [Text](./weaviate/embeddings.md) | - | - |

#### Enable all API-based modules
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,6 @@ image: og/docs/integrations/provider_integrations_voyageai.jpg
# tags: ['model providers', 'voyageai', 'embeddings']
---

# VoyageAI Multimodal Embeddings with Weaviate

:::info Added in `1.25.25`, `1.26.9` and `v1.27.2`
:::

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
import FilteredTextBlock from '@site/src/components/Documentation/FilteredTextBlock';
Expand All @@ -19,13 +14,18 @@ import TSConnect from '!!raw-loader!../_includes/provider.connect.ts';
import PyCode from '!!raw-loader!../_includes/provider.vectorizer.py';
import TSCode from '!!raw-loader!../_includes/provider.vectorizer.ts';

# VoyageAI Multimodal Embeddings with Weaviate

:::info Added in `1.27.8`
:::

Weaviate's integration with VoyageAI's APIs allows you to access their models' capabilities directly from Weaviate.

[Configure a Weaviate vector index](#configure-the-vectorizer) to use a VoyageAI embedding model, and Weaviate will generate embeddings for various operations using the specified model and your VoyageAI API key. This feature is called the *vectorizer*.

At [import time](#data-import), Weaviate generates multimodal object embeddings and saves them into the index. For [vector](#vector-near-text-search) and [hybrid](#hybrid-search) search operations, Weaviate converts text queries into embeddings. [Multimodal search operations](#vector-near-media-search) are also supported.
This integration supports CLIP-like, single-modality inputs from text or images, into a multimodal embedding space.

Important to note that the integration only supports CLIP-like multimodality. For more advanced usage with interleaved text & images, please use the [Bring your own vectors](../../starter-guides/custom-vectors.mdx) setup.
At [import time](#data-import), Weaviate generates multimodal object embeddings and saves them into the index. For [vector](#vector-near-text-search) and [hybrid](#hybrid-search) search operations, Weaviate converts text queries into embeddings. [Multimodal search operations](#vector-near-media-search) are also supported.

![Embedding integration illustration](../_includes/integration_voyageai_embedding.png)

Expand Down Expand Up @@ -305,7 +305,7 @@ The query below returns the `n` most similar objects to the input image from the

### Other integrations

- [VoyageAI text embeddings models + Weaviate](./embeddings.md).
- [VoyageAI text embedding models + Weaviate](./embeddings.md).
- [VoyageAI reranker models + Weaviate](./reranker.md).

### Code examples
Expand Down
1 change: 1 addition & 0 deletions developers/weaviate/model-providers/voyageai/embeddings.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,7 @@ The query below returns the `n` best scoring objects from the database, set by `

### Other integrations

- [Voyage AI multimodal embedding embeddings models + Weaviate](./embeddings-multimodal.md)
- [Voyage AI reranker models + Weaviate](./embeddings.md).

### Code examples
Expand Down
1 change: 1 addition & 0 deletions developers/weaviate/model-providers/voyageai/reranker.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Any search in Weaviate can be combined with a reranker to perform reranking oper
### Other integrations

- [Voyage AI embedding models + Weaviate](./embeddings.md).
- [Voyage AI multimodal embedding embeddings models + Weaviate](./embeddings-multimodal.md)

### Code examples

Expand Down

0 comments on commit 1698615

Please sign in to comment.