mirror of
https://github.com/qdrant/landing_page.git
synced 2026-10-09 12:58:31 +02:00
+39
@@ -0,0 +1,39 @@
|
||||
```java
|
||||
import static io.qdrant.client.PointIdFactory.id;
|
||||
import static io.qdrant.client.ValueFactory.value;
|
||||
import static io.qdrant.client.VectorsFactory.vectors;
|
||||
|
||||
import io.qdrant.client.QdrantClient;
|
||||
import io.qdrant.client.QdrantGrpcClient;
|
||||
import io.qdrant.client.grpc.Points.Image;
|
||||
import io.qdrant.client.grpc.Points.PointStruct;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
QdrantClient client =
|
||||
new QdrantClient(
|
||||
QdrantGrpcClient.newBuilder("xyz-example.qdrant.io", 6334, true)
|
||||
.withApiKey("<your-api-key")
|
||||
.build());
|
||||
|
||||
client
|
||||
.upsertAsync(
|
||||
"{collection_name}",
|
||||
List.of(
|
||||
PointStruct.newBuilder()
|
||||
.setId(id(1))
|
||||
.setVectors(
|
||||
vectors(
|
||||
Image.newBuilder()
|
||||
.setModel("jinaai/jina-clip-v2")
|
||||
.setImage(value("https://qdrant.tech/example.png"))
|
||||
.putAllOptions(
|
||||
Map.of(
|
||||
"jina-api-key",
|
||||
value("<YOUR_JINAAI_API_KEY>"),
|
||||
"dimensions",
|
||||
value(512)))
|
||||
.build()))
|
||||
.build()))
|
||||
.get();
|
||||
```
|
||||
Reference in New Issue
Block a user