Skip to content

Commit

Permalink
Sync OpenAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
coszio authored and GitHub Actions committed Aug 9, 2024
1 parent 0e130c1 commit 344c16e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fern/apis/master/openapi-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ paths:
- code: "use qdrant_client::Qdrant;\nuse qdrant_client::qdrant::{Condition, Filter, PointId, PrefetchQueryBuilder, Query, QueryPointsBuilder};\n\nlet client = Qdrant::from_url(\"http://localhost:6334\").build()?;\n\n// Query nearest by ID\nlet _nearest = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_nearest(PointId::new(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n).await?;\n\n// Recommend on the average of these vectors\nlet _recommendations = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_recommend(\n RecommendInputBuilder::default()\n .add_positive(vec![0.1; 8])\n .add_negative(PointId::from(0))\n ))\n).await?;\n\n// Fusion query\nlet _hybrid = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest([(1, 0.22), (42, 0.8)].as_slice()))\n .using(\"sparse\")\n .limit(20u64)\n )\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n .using(\"dense\")\n .limit(20u64)\n )\n .query(Query::new_fusion(Fusion::Rrf))\n).await?;\n\n// 2-stage query\nlet _refined = client.query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .add_prefetch(PrefetchQueryBuilder::default()\n .query(Query::new_nearest(vec![0.01, 0.45, 0.67]))\n .limit(100u64)\n )\n .query(Query::new_nearest(vec![\n vec![0.1, 0.2],\n vec![0.2, 0.1],\n vec![0.8, 0.9],\n ]))\n .using(\"colbert\")\n .limit(10u64)\n).await?;\n\n// Random sampling (as of 1.11.0)\nlet _sampled = client\n .query(\n QueryPointsBuilder::new(\"{collection_name}\")\n .query(Query::new_sample(Sample::Random))\n )\n .await?;\n"
language: rust
- code-samples:
- code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List<PrefetchQuery>\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: new FusionQuery { Fusion = Fusion.Rrf }\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List<PrefetchQuery>\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: new SampleQuery { Sample=Sample.Random }\n);\n"
- code: "using Qdrant.Client;\nusing Qdrant.Client.Grpc;\n\nvar client = new QdrantClient(\"localhost\", 6334);\n\n// Query nearest by ID\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: Guid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")\n);\n\n// Recommend on the average of these vectors\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tquery: new RecommendInput\n\t{\n\t\tPositive =\n\t\t{\n\t\t\tGuid.Parse(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\"),\n\t\t\tnew float[] { 0.11f, 0.35f, 0.6f }\n\t\t},\n\t\tNegative = { new float[] { 0.01f, 0.45f, 0.67f } }\n\t}\n);\n\n// Fusion query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List<PrefetchQuery>\n\t{\n\t\tnew()\n\t\t{\n\t\t\tQuery = new (float, uint)[] { (0.22f, 1), (0.8f, 42), },\n\t\t\tUsing = \"sparse\",\n\t\t\tLimit = 20\n\t\t},\n\t\tnew()\n\t\t{\n\t\t\tQuery = new float[] { 0.01f, 0.45f, 0.67f },\n\t\t\tUsing = \"dense\",\n\t\t\tLimit = 20\n\t\t}\n\t},\n\tquery: new FusionQuery { Fusion = Fusion.Rrf }\n);\n\n// 2-stage query\nawait client.QueryAsync(\n\tcollectionName: \"{collection_name}\",\n\tprefetch: new List<PrefetchQuery>\n\t{\n\t\tnew() { Query = new float[] { 0.01f, 0.45f, 0.67f }, Limit = 100 }\n\t},\n\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\",\n query: Sample.Random\n);\n"
language: csharp
- code-samples:
- code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static io.qdrant.client.QueryFactory.nearest;\nimport static io.qdrant.client.QueryFactory.recommend;\nimport static io.qdrant.client.VectorInputFactory.vectorInput;\n\nimport java.util.UUID;\n\nimport io.qdrant.client.QdrantClient;\nimport io.qdrant.client.QdrantGrpcClient;\nimport io.qdrant.client.grpc.Points.Fusion;\nimport io.qdrant.client.grpc.Points.PrefetchQuery;\nimport io.qdrant.client.grpc.Points.QueryPoints;\nimport io.qdrant.client.grpc.Points.RecommendInput;\n\nQdrantClient client =\n new QdrantClient(QdrantGrpcClient.newBuilder(\"localhost\", 6334, false).build());\n\n// Query nearest by ID\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(nearest(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .build())\n .get();\n\n// Recommend on the average of these vectors\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(\n recommend(\n RecommendInput.newBuilder()\n .addPositive(vectorInput(UUID.fromString(\"43cf51e2-8777-4f52-bc74-c2cbde0c8b04\")))\n .addPositive(vectorInput(0.11f, 0.35f, 0.6f))\n .addNegative(vectorInput(0.01f, 0.45f, 0.67f))\n .build()))\n .build())\n .get();\n\n// Fusion query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.22f, 0.8f), List.of(1, 42)))\n .setUsing(\"sparse\")\n .setLimit(20)\n .build())\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(List.of(0.01f, 0.45f, 0.67f)))\n .setUsing(\"dense\")\n .setLimit(20)\n .build())\n .setQuery(fusion(Fusion.RRF))\n .build())\n .get();\n\n// 2-stage query\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .addPrefetch(\n PrefetchQuery.newBuilder()\n .setQuery(nearest(0.01f, 0.45f, 0.67f))\n .setLimit(100)\n .build())\n .setQuery(\n nearest(\n new float[][] {\n {0.1f, 0.2f},\n {0.2f, 0.1f},\n {0.8f, 0.9f}\n }))\n .setUsing(\"colbert\")\n .setLimit(10)\n .build())\n .get();\n\n// Random sampling (as of 1.11.0)\nclient\n .queryAsync(\n QueryPoints.newBuilder()\n .setCollectionName(\"{collection_name}\")\n .setQuery(sample(Sample.Random))\n .build())\n .get();\n"
Expand Down
2 changes: 1 addition & 1 deletion fern/apis/v1.10.x/openapi-overrides.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1450,7 +1450,7 @@ paths:
\tquery: new float[][] { [0.1f, 0.2f], [0.2f, 0.1f], [0.8f, 0.9f] },\n\
\tusingVector: \"colbert\",\n\tlimit: 10\n);\n\n// Random sampling (as\
\ of 1.11.0)\nawait client.QueryAsync(\n collectionName: \"{collection_name}\"\
,\n query: new SampleQuery { Sample=Sample.Random }\n);\n"
,\n query: Sample.Random\n);\n"
language: csharp
- code-samples:
- code: "import static io.qdrant.client.QueryFactory.fusion;\nimport static\
Expand Down

0 comments on commit 344c16e

Please sign in to comment.