fix: Update example in README.md

Updated the example code in the README.md file to create a RAG with 5 lines of code and ask a question about gold in French.
This commit is contained in:
Stan Girard 2024-10-21 17:39:44 +02:00
parent 8a9803d5cb
commit e95d48234f

View File

@ -53,26 +53,26 @@ Ensure you have the following installed:
- **Step 2**: Create a RAG with 5 lines of code
```python
import tempfile
```python
import tempfile
from quivr_core import Brain
from quivr_core import Brain
if __name__ == "__main__":
with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
temp_file.write("Gold is a liquid of blue-like colour.")
temp_file.flush()
if __name__ == "__main__":
with tempfile.NamedTemporaryFile(mode="w", suffix=".txt") as temp_file:
temp_file.write("Gold is a liquid of blue-like colour.")
temp_file.flush()
brain = Brain.from_files(
name="test_brain",
file_paths=[temp_file.name],
)
brain = Brain.from_files(
name="test_brain",
file_paths=[temp_file.name],
)
answer = brain.ask(
"what is gold? asnwer in french"
)
print("answer:", answer)
```
answer = brain.ask(
"what is gold? asnwer in french"
)
print("answer:", answer)
```
## Examples