diff --git a/srctag/cli.py b/srctag/cli.py new file mode 100644 index 0000000..93709fb --- /dev/null +++ b/srctag/cli.py @@ -0,0 +1,31 @@ +import chromadb +import click + +from chromadb.utils.embedding_functions import SentenceTransformerEmbeddingFunction + + +@click.group() +def cli(): + pass + + +@cli.command() +def prepare(): + # try to embed + chromadb_cli = chromadb.Client() + collection = chromadb_cli.get_or_create_collection( + "testonly", + embedding_function=SentenceTransformerEmbeddingFunction(), + ) + collection.add( + documents=["doc"], + metadatas=[{}], + ids=["id"], + ) + assert collection.count() == 1 + + click.echo("ok.") + + +if __name__ == '__main__': + cli()