@@ -31,6 +31,9 @@ def _fail(message: str) -> None:
|
|||||||
raise typer.Exit(1)
|
raise typer.Exit(1)
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# LIST COLLECTIONS
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command(
|
@app.command(
|
||||||
"list-collections",
|
"list-collections",
|
||||||
help="List all collections stored in the local Chroma database.",
|
help="List all collections stored in the local Chroma database.",
|
||||||
@@ -39,6 +42,9 @@ def list_collections() -> None:
|
|||||||
_run(handle_list_collections)
|
_run(handle_list_collections)
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# CREATE A COLLECTION
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command(
|
@app.command(
|
||||||
"create-collection",
|
"create-collection",
|
||||||
help="Create a collection in the local Chroma database.",
|
help="Create a collection in the local Chroma database.",
|
||||||
@@ -55,6 +61,9 @@ def create_collection(
|
|||||||
_fail(f"Collection '{collection}' already exists.")
|
_fail(f"Collection '{collection}' already exists.")
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# DELETE A COLLECTION
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command(
|
@app.command(
|
||||||
"delete-collection",
|
"delete-collection",
|
||||||
help="Delete a collection from the local Chroma database.",
|
help="Delete a collection from the local Chroma database.",
|
||||||
@@ -71,6 +80,9 @@ def delete_collection(
|
|||||||
_fail(f"Collection '{collection}' does not exist.")
|
_fail(f"Collection '{collection}' does not exist.")
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# COUNT RECORDS
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command(
|
@app.command(
|
||||||
"count",
|
"count",
|
||||||
help="Count records in a collection from the local Chroma database.",
|
help="Count records in a collection from the local Chroma database.",
|
||||||
@@ -87,6 +99,9 @@ def count(
|
|||||||
_fail(f"Collection '{collection}' does not exist.")
|
_fail(f"Collection '{collection}' does not exist.")
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# IMPORT DATA
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command(
|
@app.command(
|
||||||
"import",
|
"import",
|
||||||
help="Chunk, embed, and add a file to a collection in the local Chroma database.",
|
help="Chunk, embed, and add a file to a collection in the local Chroma database.",
|
||||||
@@ -109,6 +124,9 @@ def import_data(
|
|||||||
_fail(f"The file {file} was not found.")
|
_fail(f"The file {file} was not found.")
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# QUERY
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command("query", help="Query a collection with the provided text.")
|
@app.command("query", help="Query a collection with the provided text.")
|
||||||
def query(
|
def query(
|
||||||
collection: Annotated[
|
collection: Annotated[
|
||||||
@@ -126,6 +144,9 @@ def query(
|
|||||||
_fail(f"Collection '{collection}' does not exist.")
|
_fail(f"Collection '{collection}' does not exist.")
|
||||||
|
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# DELETE DATA
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
@app.command("delete", help="Delete records from a collection using a metadata filter.")
|
@app.command("delete", help="Delete records from a collection using a metadata filter.")
|
||||||
def delete_records(
|
def delete_records(
|
||||||
collection: Annotated[
|
collection: Annotated[
|
||||||
|
|||||||
Reference in New Issue
Block a user