mirror of
https://github.com/qdrant/landing_page.git
synced 2026-09-28 23:48:31 +02:00
docs: TestContainers integration (#710)
* docs: TestContainers integration * docs: refactor Spring AI docs * docs: review changes * Apply suggestions from code review Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com> * Apply suggestions from code review Co-authored-by: Mike Jang <michael.jang@qdrant.io> * Update qdrant-landing/content/documentation/frameworks/spring-ai.md Co-authored-by: Mike Jang <michael.jang@qdrant.io> * chore: Updated preview image * Update qdrant-landing/content/documentation/frameworks/testcontainers.md * docs: Commented out Node/Python modules --------- Co-authored-by: Eddú Meléndez Gonzales <eddu.melendez@gmail.com> Co-authored-by: Mike Jang <michael.jang@qdrant.io>
This commit is contained in:
co-authored by
Eddú Meléndez Gonzales
Mike Jang
parent
366e5d2fce
commit
a21aa0c2ab
@@ -11,32 +11,31 @@ Qdrant is available as supported vector database for use within your Spring AI p
|
||||
|
||||
## Installation
|
||||
|
||||
To acquire Spring AI artifacts, declare the Spring Snapshot repository in your `pom.xml`.
|
||||
You can find the Spring AI installation instructions [here](https://docs.spring.io/spring-ai/reference/getting-started.html).
|
||||
|
||||
```xml
|
||||
<repository>
|
||||
<id>spring-snapshots</id>
|
||||
<name>Spring Snapshots</name>
|
||||
<url>https://repo.spring.io/snapshot</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
</repository>
|
||||
```
|
||||
|
||||
Add the `spring-ai-qdrant` package.
|
||||
Add the Qdrant boot starter package.
|
||||
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-qdrant</artifactId>
|
||||
<version>VERSION</version>
|
||||
<groupId>org.springframework.ai</groupId>
|
||||
<artifactId>spring-ai-qdrant-store-spring-boot-starter</artifactId>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
You can set up the Qdrant vector store with the `QdrantVectorStoreConfig` options.
|
||||
Configure Qdrant with Spring Boot’s `application.properties`.
|
||||
|
||||
```
|
||||
spring.ai.vectorstore.qdrant.host=<host of your qdrant instance>
|
||||
spring.ai.vectorstore.qdrant.port=<the GRPC port of your qdrant instance>
|
||||
spring.ai.vectorstore.qdrant.api-key=<your api key>
|
||||
spring.ai.vectorstore.qdrant.collection-name=<The name of the collection to use in Qdrant>
|
||||
```
|
||||
|
||||
Learn more about these options in the [configuration reference](https://docs.spring.io/spring-ai/reference/api/vectordbs/qdrant.html#qdrant-vectorstore-properties).
|
||||
|
||||
Or you can set up the Qdrant vector store with the `QdrantVectorStoreConfig` options.
|
||||
|
||||
```java
|
||||
@Bean
|
||||
@@ -51,8 +50,6 @@ public QdrantVectorStoreConfig qdrantVectorStoreConfig() {
|
||||
}
|
||||
```
|
||||
|
||||
<aside role="status">You'll need to <a href="/documentation/concepts/collections/#create-a-collection">create a collection</a> with the appropriate vector dimensions and configurations in advance.</aside>
|
||||
|
||||
Build the vector store using the config and any of the support [Spring AI embedding providers](https://docs.spring.io/spring-ai/reference/api/embeddings.html#available-implementations).
|
||||
|
||||
```java
|
||||
@@ -64,6 +61,9 @@ public VectorStore vectorStore(QdrantVectorStoreConfig config, EmbeddingClient e
|
||||
|
||||
You can now use the `VectorStore` instance backed by Qdrant as a vector store in the Spring AI APIs.
|
||||
|
||||
## Further Reading
|
||||
<aside role="status">If the collection is not <a href="/documentation/concepts/collections/#create-a-collection">created in advance</a>, <code>QdrantVectorStore</code> will attempt to create one using cosine similarity and the dimension of the configured <code>EmbeddingClient</code>.</aside>
|
||||
|
||||
- 📚 Spring AI [reference](https://docs.spring.io/spring-ai/reference/index.html)
|
||||
## 📚 Further Reading
|
||||
|
||||
- Spring AI [Qdrant reference](https://docs.spring.io/spring-ai/reference/api/vectordbs/qdrant.html)
|
||||
- Spring AI [API reference](https://docs.spring.io/spring-ai/reference/index.html)
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
---
|
||||
title: Testcontainers
|
||||
weight: 2700
|
||||
---
|
||||
|
||||
# Testcontainers
|
||||
|
||||
Qdrant is available as a [Testcontainers module](https://testcontainers.com/modules/qdrant/) in multiple languages. It facilitates the spawning of a Qdrant instance for end-to-end testing.
|
||||
|
||||
As noted by [Testcontainers](https://testcontainers.com/), it "is an open source framework for providing throwaway, lightweight instances of databases, message brokers, web browsers, or just about anything that can run in a Docker container."
|
||||
|
||||
## Usage
|
||||
|
||||
```java
|
||||
import org.testcontainers.qdrant.QdrantContainer;
|
||||
|
||||
QdrantContainer qdrantContainer = new QdrantContainer("qdrant/qdrant");
|
||||
```
|
||||
|
||||
```go
|
||||
import (
|
||||
"github.com/testcontainers/testcontainers-go"
|
||||
"github.com/testcontainers/testcontainers-go/modules/qdrant"
|
||||
)
|
||||
|
||||
qdrantContainer, err := qdrant.RunContainer(ctx, testcontainers.WithImage("qdrant/qdrant"))
|
||||
```
|
||||
|
||||
<!--
|
||||
```typescript
|
||||
import { QdrantContainer } from "@testcontainers/qdrant";
|
||||
|
||||
const qdrantContainer = await new QdrantContainer("qdrant/qdrant").start();
|
||||
```
|
||||
|
||||
```python
|
||||
from testcontainers.qdrant import QdrantContainer
|
||||
|
||||
qdrant_container = QdrantContainer("qdrant/qdrant").start()
|
||||
```
|
||||
-->
|
||||
|
||||
Testcontainers modules provide options/methods to configure ENVs, volumes, and virtually everything you can configure in a Docker container.
|
||||
|
||||
## Further reading
|
||||
|
||||
- [Testcontainers Guides](https://testcontainers.com/guides/)
|
||||
- [Testcontainers Qdrant Module](https://testcontainers.com/modules/qdrant/)
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 662 KiB |
@@ -73,6 +73,13 @@ $tabs-font-color-hover: var(--neutral-n-600);
|
||||
}
|
||||
}
|
||||
|
||||
&_go {
|
||||
&:before {
|
||||
-webkit-mask-image: url("/css/assets/lang-switcher/go.svg");
|
||||
mask-image: url("/css/assets/lang-switcher/go.svg");
|
||||
}
|
||||
}
|
||||
|
||||
&:not(.active):hover {
|
||||
background: $tabs-bg-color-hover;
|
||||
color: $tabs-font-color-hover;
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3.8-5.5-7.2-4.7-3.3.7-5.4 2.8-6.2 6.1-.6 2.7.7 5.5 3.2 6.7 1.9.8 3.9.7 5.7-.2 2.9-1.4 4.4-3.7 4.6-6.7z"/></g></switch></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user