First take on a rag tool

This commit is contained in:
Gui Vieira
2024-02-13 20:10:56 -03:00
parent 54e4554f49
commit c1182eb322
22 changed files with 454 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
from crewai_tools.adapters.lancedb_adapter import LanceDBAdapter
def test_lancedb_adapter(helpers):
adapter = LanceDBAdapter(
uri="tests/data/lancedb",
table_name="requirements",
embedding_function=helpers.get_embedding_function(),
top_k=2,
vector_column_name="vector",
text_column_name="text",
)
assert (
adapter.query("What are the requirements for the task?")
== """Technical requirements
The system should be able to process 1000 transactions per second. The code must be written in Ruby.
Problem
Currently, we are not able to find out palindromes in a given string. We need a solution to this problem."""
)