Feature/fix cli and readme rebased (#593)

* unpack, and fix docs to reflect this (#583)

* fix readme (#587)

* fix readme
This commit is contained in:
emrgnt-cmplxty
2024-06-30 18:40:34 -07:00
committed by GitHub
parent 6abd883548
commit a05dff513b
2 changed files with 5 additions and 15 deletions
+4 -14
View File
@@ -245,26 +245,16 @@ app.ingest_documents(
rag_results = app.rag(
"Who is john", GenerationConfig(model="gpt-3.5-turbo", temperature=0.0)
)
print(f"Search Results:\n{response['search_results']}")
print(f"Completion:\n{response['completion']}")
print(f"Search Results:\n{rag_results.search_results}")
print(f"Completion:\n{rag_results.completion}")
# RAG Results:
# Search Results:
# {'vector_search_results': [
# {'id': '7ed3a01c-88dc-5a58-a68b-6e5d9f292df2',
# 'score': 0.7802911996841491,
# 'metadata': {'text': 'Aristotle[A] (Greek: Ἀριστοτέλης Aristotélēs, pronounced [aristotélɛːs]; 384322 BC) was an Ancient Greek philosopher and polymath. His writings cover a broad range of subjects spanning the natural sciences, philosophy, linguistics, economics, politics, psychology, and the arts. As the founder of the Peripatetic schoo
# ...
# AggregateSearchResult(vector_search_results=[VectorSearchResult(id=2d71e689-0a0e-5491-a50b-4ecb9494c832, score=0.6848798582029441, metadata={'text': 'John is a person that works at Google.', 'version': 'v0', 'chunk_order': 0, 'document_id': 'ed76b6ee-dd80-5172-9263-919d493b439a', 'extraction_id': '1ba494d7-cb2f-5f0e-9f64-76c31da11381', 'associatedQuery': 'Who is john'})], kg_search_results=None)
# Completion:
# {'results': [
# {
# 'id': 'chatcmpl-9eXL6sKWlUkP3f6QBnXvEiKkWKBK4',
# 'choices': [
# ...
# ChatCompletion(id='chatcmpl-9g0HnjGjyWDLADe7E2EvLWa35cMkB', choices=[Choice(finish_reason='stop', index=0, logprobs=None, message=ChatCompletionMessage(content='John is a person that works at Google [1].', role='assistant', function_call=None, tool_calls=None))], created=1719797903, model='gpt-3.5-turbo-0125', object='chat.completion', service_tier=None, system_fingerprint=None, usage=CompletionUsage(completion_tokens=11, prompt_tokens=145, total_tokens=156))
```
# R2R Dashboard
Interact with R2R using our [open-source React+Next.js dashboard](https://github.com/SciPhi-AI/R2R-Dashboard). Check out the [Dashboard Cookbook](https://r2r-docs.sciphi.ai/cookbooks/dashboard) to get started!
+1 -1
View File
@@ -87,7 +87,7 @@ def ingest(obj, file_paths, no_media):
file_paths = list(file_paths)
if not file_paths:
root_path = os.path.dirname(os.path.abspath(__file__))
file_paths = [os.path.join(root_path, "data", "aristotle.txt")]
file_paths = [os.path.join(root_path, "..", "examples", "data", "aristotle.txt")]
if no_media:
excluded_types = ["jpeg", "jpg", "png", "svg", "mp3", "mp4"]