format code

This commit is contained in:
Matteo Rosati
2026-04-22 22:22:49 +02:00
parent 0441bcd911
commit f09e9da9a5
3 changed files with 8 additions and 4 deletions
+2 -1
View File
@@ -70,7 +70,8 @@ def add_data(
_, collection = _get_client_and_collection(collection_name) _, collection = _get_client_and_collection(collection_name)
embeddings: list[Sequence[float]] = [record["embedding"] for record in data] embeddings: list[Sequence[float]] = [record["embedding"]
for record in data]
collection.add( collection.add(
ids=[str(uuid4()) for _ in data], ids=[str(uuid4()) for _ in data],
+2 -1
View File
@@ -98,7 +98,8 @@ def add_data(
], ],
file: Annotated[ file: Annotated[
str, str,
typer.Argument(help="Path to the file to chunk and add to the collection."), typer.Argument(
help="Path to the file to chunk and add to the collection."),
], ],
) -> None: ) -> None:
try: try:
+4 -2
View File
@@ -7,13 +7,15 @@ def _parse_where_clause(where_clause: str) -> dict[str, str]:
condition, separator, value = where_clause.partition("=") condition, separator, value = where_clause.partition("=")
if separator == "": if separator == "":
raise ValueError("Invalid --where value. Expected <condition>=<value>.") raise ValueError(
"Invalid --where value. Expected <condition>=<value>.")
condition = condition.strip() condition = condition.strip()
value = value.strip() value = value.strip()
if not condition or not value: if not condition or not value:
raise ValueError("Invalid --where value. Expected <condition>=<value>.") raise ValueError(
"Invalid --where value. Expected <condition>=<value>.")
return {condition: value} return {condition: value}