mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-08 04:18:32 +02:00
inference ts snippets
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
query: {
|
||||
text: 'a green square',
|
||||
model: 'cohere/embed-v4.0',
|
||||
options: {
|
||||
'cohere-api-key': '<your_cohere_api_key>',
|
||||
output_dimension: 512,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.upsert("{collection_name}", {
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
vector: {
|
||||
text: 'a green square',
|
||||
model: 'cohere/embed-v4.0',
|
||||
options: {
|
||||
'cohere-api-key': '<your_cohere_api_key>',
|
||||
output_dimension: 512,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,19 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.upsert("{collection_name}", {
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
vector: {
|
||||
'my-bm25-vector': {
|
||||
text: 'Recipe for baking chocolate chip cookies',
|
||||
model: 'Qdrant/bm25',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
query: {
|
||||
text: 'Mission to Mars',
|
||||
model: 'jinaai/jina-clip-v2',
|
||||
options: {
|
||||
'jina-api-key': '<your_jinaai_api_key>',
|
||||
dimensions: 512,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.upsert("{collection_name}", {
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
vector: {
|
||||
image: 'https://qdrant.tech/example.png',
|
||||
model: 'jinaai/jina-clip-v2',
|
||||
options: {
|
||||
'jina-api-key': '<your_jinaai_api_key>',
|
||||
dimensions: 512,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.upsert("{collection_name}", {
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
vector: {
|
||||
image: {
|
||||
image: 'https://qdrant.tech/example.png',
|
||||
model: 'jinaai/jina-clip-v2',
|
||||
options: {
|
||||
'jina-api-key': '<your_jinaai_api_key>',
|
||||
dimensions: 512,
|
||||
},
|
||||
},
|
||||
text: {
|
||||
text: 'Mars, the red planet',
|
||||
model: 'sentence-transformers/all-minilm-l6-v2',
|
||||
},
|
||||
bm25: {
|
||||
text: 'Mars, the red planet',
|
||||
model: 'Qdrant/bm25',
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
query: {
|
||||
text: 'How to bake cookies?',
|
||||
model: 'openai/text-embedding-3-large',
|
||||
options: {
|
||||
'openai-api-key': '<your_openai_api_key>',
|
||||
dimensions: 512,
|
||||
},
|
||||
},
|
||||
});
|
||||
```
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.upsert("{collection_name}", {
|
||||
points: [
|
||||
{
|
||||
id: 1,
|
||||
vector: {
|
||||
text: 'Recipe for baking chocolate chip cookies',
|
||||
model: 'openai/text-embedding-3-large',
|
||||
options: {
|
||||
'openai-api-key': '<your_openai_api_key>',
|
||||
dimensions: 512,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
});
|
||||
```
|
||||
@@ -0,0 +1,13 @@
|
||||
```typescript
|
||||
import { QdrantClient } from "@qdrant/js-client-rest";
|
||||
|
||||
const client = new QdrantClient({ host: "localhost", port: 6333 });
|
||||
|
||||
client.query("{collection_name}", {
|
||||
query: {
|
||||
text: 'How to bake cookies?',
|
||||
model: 'qdrant/bm25',
|
||||
},
|
||||
using: 'my-bm25-vector',
|
||||
});
|
||||
```
|
||||
Reference in New Issue
Block a user