fix and refactor python examples (#770)

* fix: fix points selector bugs, refactor code

* fix: fix and refactor embeddings

* fix: fix and refactor frameworks

* refactor: refactor guides

* fix: fix and refactor aleph-alpha tutorial

* fix: fix and refactor tutorials

* refactoring: refactor quick-start

* fix: address review comments

* fix: replace remaining host
This commit is contained in:
George
2024-04-03 13:17:45 +02:00
committed by GitHub
parent 5441805449
commit 92f8196651
38 changed files with 202 additions and 233 deletions
@@ -83,10 +83,9 @@ POST /collections/{collection_name}/points/search
```
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
from qdrant_client import QdrantClient, models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -250,9 +249,8 @@ POST /collections/{collection_name}/points/search
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -358,10 +356,9 @@ POST /collections/{collection_name}/points/search
```
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
from qdrant_client import QdrantClient, models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -562,9 +559,8 @@ POST /collections/{collection_name}/points/search
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -656,10 +652,9 @@ POST /collections/{collection_name}/points/search
```
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
from qdrant_client import QdrantClient, models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -808,12 +803,11 @@ POST /collections/{collection_name}/points/search/batch
```
```python
from qdrant_client import QdrantClient
from qdrant_client.http import models
from qdrant_client import QdrantClient, models
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
filter = models.Filter(
filter_ = models.Filter(
must=[
models.FieldCondition(
key="city",
@@ -825,8 +819,8 @@ filter = models.Filter(
)
search_queries = [
models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter, limit=3),
models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter, limit=3),
models.SearchRequest(vector=[0.2, 0.1, 0.9, 0.7], filter=filter_, limit=3),
models.SearchRequest(vector=[0.5, 0.3, 0.2, 0.3], filter=filter_, limit=3),
]
client.search_batch(collection_name="{collection_name}", requests=search_queries)
@@ -1003,7 +997,7 @@ POST /collections/{collection_name}/points/search
```python
from qdrant_client import QdrantClient
client = QdrantClient("localhost", port=6333)
client = QdrantClient(url="http://localhost:6333")
client.search(
collection_name="{collection_name}",
@@ -1185,7 +1179,7 @@ POST /collections/{collection_name}/points/search/groups
client.search_groups(
collection_name="{collection_name}",
# Same as in the regular search() API
query_vector=g,
query_vector=[1.1],
# Grouping parameters
group_by="document_id", # Path of the field to group by
limit=4, # Max amount of groups