From 2b0160126a8f801ac814af7d62bada0a84875ebb Mon Sep 17 00:00:00 2001 From: George Date: Thu, 31 Jul 2025 21:00:32 +0300 Subject: [PATCH] tests: extend remote inference tests (#1055) --- tests/test_remote_inference.py | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/test_remote_inference.py b/tests/test_remote_inference.py index d352746f..df934564 100644 --- a/tests/test_remote_inference.py +++ b/tests/test_remote_inference.py @@ -18,7 +18,9 @@ def test_remote_inference_image(): client = QdrantClient(url=QDRANT_URL, api_key=QDRANT_API_KEY, cloud_inference=True) collection_name = "image_embeddings" model_name = "Qdrant/clip-ViT-B-32-vision" - + dim = 512 # Dimension of the CLIP ViT-B/32 model, + # we can't use get_embedding_size since it requires fastembed to be installed, + # and it is not required for cloud_inference image_url = "https://qdrant.tech/example.png" # Compare inference of image exposed via url and local file @@ -37,9 +39,7 @@ def test_remote_inference_image(): client.create_collection( collection_name=collection_name, - vectors_config=models.VectorParams( - size=client.get_embedding_size(model_name), distance=models.Distance.COSINE - ), + vectors_config=models.VectorParams(size=dim, distance=models.Distance.COSINE), ) client.upsert( @@ -61,3 +61,19 @@ def test_remote_inference_image(): ), ], ) + + client.query_points( + collection_name, + query=models.FusionQuery(fusion=models.Fusion.RRF), + prefetch=[ + models.Prefetch( + query=models.Image( + image=image_url, + model=model_name, + ), + ), + models.Prefetch( + query=models.Image(image=read_base64(image_path), model=model_name), + ), + ], + )