Skip to content

Commit afe03c8

Browse files
Qdrant
1 parent a4b1f34 commit afe03c8

File tree

2 files changed

+24
-12
lines changed

2 files changed

+24
-12
lines changed

docs/modules/qdrant.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# Qdrant Module
2-
3-
[Qdrant](https://qdrant.tech/) is an open-source, high-performance vector search engine/database. It provides a production-ready service with a convenient API to store, search, and manage points (i.e. vectors) with an additional payload.
1+
# Qdrant
42

53
## Install
64

@@ -10,15 +8,29 @@ npm install @testcontainers/qdrant --save-dev
108

119
## Examples
1210

11+
These examples use the following libraries:
12+
13+
- [@qdrant/js-client-rest](https://www.npmjs.com/package/@qdrant/js-client-rest)
14+
15+
npm install @qdrant/js-client-rest
16+
17+
Choose an image from the [container registry](https://hub.docker.com/r/qdrant/qdrant) and substitute `IMAGE`.
18+
19+
### Fetch collections
20+
1321
<!--codeinclude-->
14-
[Connect to Qdrant:](../../packages/modules/qdrant/src/qdrant-container.test.ts)
22+
[](../../packages/modules/qdrant/src/qdrant-container.test.ts)
1523
inside_block:connectQdrantSimple
1624
<!--/codeinclude-->
1725

26+
### With API key
27+
1828
<!--codeinclude-->
19-
[Connect to Qdrant with an API key:](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithApiKey
29+
[](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithApiKey
2030
<!--/codeinclude-->
2131

32+
### With config file
33+
2234
<!--codeinclude-->
23-
[Customize Qdrant instance with a config file:](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithConfig
35+
[](../../packages/modules/qdrant/src/qdrant-container.test.ts) inside_block:connectQdrantWithConfig
2436
<!--/codeinclude-->

packages/modules/qdrant/src/qdrant-container.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,27 +7,27 @@ import { QdrantContainer } from "./qdrant-container";
77
const IMAGE = getImage(__dirname);
88

99
describe("QdrantContainer", { timeout: 100_000 }, () => {
10-
// connectQdrantSimple {
1110
it("should connect to the client", async () => {
11+
// connectQdrantSimple {
1212
await using container = await new QdrantContainer(IMAGE).start();
1313

1414
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}` });
1515

1616
expect((await client.getCollections()).collections.length).toBe(0);
17+
// }
1718
});
18-
// }
1919

20-
// connectQdrantWithApiKey {
2120
it("should work with valid API keys", async () => {
21+
// connectQdrantWithApiKey {
2222
const apiKey = crypto.randomUUID();
2323

2424
await using container = await new QdrantContainer(IMAGE).withApiKey(apiKey).start();
2525

2626
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}`, apiKey });
27+
// }
2728

2829
expect((await client.getCollections()).collections.length).toBe(0);
2930
});
30-
// }
3131

3232
it("should fail for invalid API keys", async () => {
3333
const apiKey = crypto.randomUUID();
@@ -42,17 +42,17 @@ describe("QdrantContainer", { timeout: 100_000 }, () => {
4242
await expect(client.getCollections()).rejects.toThrow("Unauthorized");
4343
});
4444

45-
// connectQdrantWithConfig {
4645
it("should work with config files - valid API key", async () => {
46+
// connectQdrantWithConfig {
4747
await using container = await new QdrantContainer(IMAGE)
4848
.withConfigFile(path.resolve(__dirname, "test_config.yaml"))
4949
.start();
5050

5151
const client = new QdrantClient({ url: `http://${container.getRestHostAddress()}`, apiKey: "SOME_TEST_KEY" });
52+
// }
5253

5354
expect((await client.getCollections()).collections.length).toBe(0);
5455
});
55-
// }
5656

5757
it("should work with config files - invalid API key", async () => {
5858
await using container = await new QdrantContainer(IMAGE)

0 commit comments

Comments
 (0)