2024-07-09 16:22:16 +03:00
|
|
|
import tempfile
|
|
|
|
from quivr_core import Brain
|
2024-09-03 16:23:23 +03:00
|
|
|
from quivr_core.quivr_rag_langgraph import QuivrQARAGLangGraph
|
|
|
|
from quivr_core.quivr_rag import QuivrQARAG
|
2024-07-09 16:22:16 +03:00
|
|
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
|
2024-09-03 16:23:23 +03:00
|
|
|
temp_file.write("Gold is a liquid of blue-like colour.")
|
2024-07-09 16:22:16 +03:00
|
|
|
temp_file.flush()
|
|
|
|
|
2024-09-03 16:23:23 +03:00
|
|
|
brain = Brain.from_files(name="test_brain",
|
|
|
|
file_paths=[temp_file.name],
|
|
|
|
)
|
2024-07-09 16:22:16 +03:00
|
|
|
|
2024-09-03 16:23:23 +03:00
|
|
|
answer = brain.ask("what is gold? asnwer in french",
|
|
|
|
rag_pipeline=QuivrQARAGLangGraph)
|
|
|
|
print("answer QuivrQARAGLangGraph :", answer.answer)
|
|
|
|
|
2024-07-19 10:47:39 +03:00
|
|
|
|
2024-09-03 16:23:23 +03:00
|
|
|
answer = brain.ask("what is gold? asnwer in french",
|
|
|
|
rag_pipeline=QuivrQARAG)
|
|
|
|
print("answer QuivrQARAG :", answer.answer)
|