2024-07-09 16:22:16 +03:00
|
|
|
import tempfile
|
2024-09-13 16:35:28 +03:00
|
|
|
|
2024-07-09 16:22:16 +03:00
|
|
|
from quivr_core import Brain
|
2024-09-13 16:35:28 +03:00
|
|
|
from quivr_core.quivr_rag_langgraph import QuivrQARAGLangGraph
|
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-13 16:35:28 +03:00
|
|
|
brain = Brain.from_files(
|
|
|
|
name="test_brain",
|
|
|
|
file_paths=[temp_file.name],
|
|
|
|
)
|
2024-07-09 16:22:16 +03:00
|
|
|
|
2024-09-13 16:35:28 +03:00
|
|
|
answer = brain.ask(
|
|
|
|
"what is gold? asnwer in french", rag_pipeline=QuivrQARAGLangGraph
|
|
|
|
)
|
2024-09-03 16:23:23 +03:00
|
|
|
print("answer QuivrQARAGLangGraph :", answer.answer)
|