generated from The-Swarm-Corporation/Multi-Agent-Template-App
-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Kye Gomez
authored and
Kye Gomez
committed
Jul 8, 2024
1 parent
32e53cd
commit 5bd4b4b
Showing
3 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from swarms_memory import ChromaDB | ||
|
||
chromadb = ChromaDB( | ||
metric="cosine", | ||
output_dir="results", | ||
limit_tokens=1000, | ||
n_results=2, | ||
docs_folder="path/to/docs", | ||
verbose=True, | ||
) | ||
|
||
# Add a document | ||
doc_id = chromadb.add("This is a test document.") | ||
|
||
# Query the document | ||
result = chromadb.query("This is a test query.") | ||
|
||
# Traverse a directory | ||
chromadb.traverse_directory() | ||
|
||
# Display the result | ||
print(result) |
Empty file.