"INFO:numexpr.utils:Note: NumExpr detected 12 cores but \"NUMEXPR_MAX_THREADS\" not set, so enforcing safe limit of 8.\n",
"Note: NumExpr detected 12 cores but \"NUMEXPR_MAX_THREADS\" not set, so enforcing safe limit of 8.\n",
"INFO:numexpr.utils:NumExpr defaulting to 8 threads.\n",
"NumExpr defaulting to 8 threads.\n"
]
},
{
"name": "stderr",
"output_type": "stream",
"text": [
"/Users/suo/miniconda3/envs/llama/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.7) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.\n",
"INFO:llama_index.chat_engine.condense_question:Querying with: What was the next step in Paul Graham's career after his involvement with Y Combinator?\n",
"Querying with: What was the next step in Paul Graham's career after his involvement with Y Combinator?\n"
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"INFO:llama_index.core.chat_engine.condense_question:Querying with: What did Paul Graham do after his time at Y Combinator?\n",
"Querying with: What did Paul Graham do after his time at Y Combinator?\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
"response_stream = chat_engine.chat(\"What did Paul Graham do after YC?\")"
"response_stream = chat_engine.stream_chat(\"What did Paul Graham do after YC?\")"
]
},
{
...
...
@@ -144,8 +158,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Paul Graham's next step in his career after his involvement with Y Combinator was to take up painting. He spent most of the rest of 2014 painting and then in March 2015 he started working on Lisp again.\n"
"Paul Graham decided to hand over Y Combinator to someone else after his time there. He asked Jessica if she wanted to be president, but she declined. Eventually, they recruited Sam Altman to take over as president. Paul Graham, along with Robert, retired from Y Combinator, while Jessica and Trevor became ordinary partners."
]
}
],
...
...
@@ -172,13 +185,19 @@
"name": "stdout",
"output_type": "stream",
"text": [
"INFO:llama_index.chat_engine.condense_question:Querying with: What did Paul Graham do after he started working on Lisp again in March 2015?\n",
"Querying with: What did Paul Graham do after he started working on Lisp again in March 2015?\n"
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"INFO:llama_index.core.chat_engine.condense_question:Querying with: What did Paul Graham do after handing over Y Combinator to Sam Altman and retiring from the company?\n",
"Querying with: What did Paul Graham do after handing over Y Combinator to Sam Altman and retiring from the company?\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
]
}
],
"source": [
"response_stream = chat_engine.chat(\"What about after that?\")"
"response_stream = chat_engine.stream_chat(\"What about after that?\")"
]
},
{
...
...
@@ -191,8 +210,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Paul Graham spent the rest of 2015 writing essays and working on the new dialect of Lisp he called Arc. He also looked for an apartment to buy and started to plan a second still life painting from the same objects.\n"
"After handing over Y Combinator to Sam Altman and retiring from the company, Paul Graham started his own investment firm with Jessica."
]
}
],
...
...
@@ -210,13 +228,19 @@
"name": "stdout",
"output_type": "stream",
"text": [
"INFO:llama_index.chat_engine.condense_question:Querying with: What did Paul Graham do after he started working on the new dialect of Lisp he called Arc in 2015?\n",
"Querying with: What did Paul Graham do after he started working on the new dialect of Lisp he called Arc in 2015?\n"
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"INFO:llama_index.core.chat_engine.condense_question:Querying with: Can you tell me more about Paul Graham's investment firm that he started with Jessica after retiring from Y Combinator?\n",
"Querying with: Can you tell me more about Paul Graham's investment firm that he started with Jessica after retiring from Y Combinator?\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
]
}
],
"source": [
"response_stream = chat_engine.chat(\"Can you tell me more?\")"
"response_stream = chat_engine.stream_chat(\"Can you tell me more?\")"
]
},
{
...
...
@@ -229,8 +253,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"Paul Graham worked on the new dialect of Lisp he called Arc for four years, from March 26, 2015 to October 12, 2019. During this time, he wrote the new Lisp, called Bel, in Arc. He also wrote essays and took his children to the coast on a sunny day in 2015. In the summer of 2016, he and his family moved to England. Finally, in the fall of 2019, he finished the project.\n"
"Paul Graham started an investment firm with Jessica after retiring from Y Combinator. They decided to create their own investment firm to implement the ideas they had been discussing. Paul funded the firm, allowing Jessica to quit her job and work for it, while also bringing on Robert and Trevor as partners. The firm was structured as an angel firm, which was a novel concept at the time. They aimed not only to make seed investments but also to provide comprehensive support to startups, similar to the help they had received when starting their own company. The investment firm was not organized as a fund and was funded with their own money. The distinctive aspect of their approach was the batch model, where they funded multiple startups at once and provided intensive support over a three-month period."
]
}
],
...
...
@@ -267,13 +290,19 @@
"name": "stdout",
"output_type": "stream",
"text": [
"INFO:llama_index.chat_engine.condense_question:Querying with: What happens after the current situation?\n",
"Querying with: What happens after the current situation?\n"
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"INFO:llama_index.core.chat_engine.condense_question:Querying with: What will happen after that?\n",
"Querying with: What will happen after that?\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/embeddings \"HTTP/1.1 200 OK\"\n",
"INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n",
"HTTP Request: POST https://api.openai.com/v1/chat/completions \"HTTP/1.1 200 OK\"\n"
]
}
],
"source": [
"response_stream = chat_engine.chat(\"What about after that?\")"
"response_stream = chat_engine.stream_chat(\"What about after that?\")"
]
},
{
...
...
@@ -286,8 +315,7 @@
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"After the current situation, the narrator resumes painting and experimenting with a new kind of still life. He also resumes his old life in New York, now that he is rich. He is able to take taxis and eat in restaurants, which is exciting for a while. He also starts to connect with other people who are trying to paint in New York.\n"
"After that, the individual started working on Lisp again in March 2015. The distinctive aspect of Lisp is that its core is a language defined by writing an interpreter in itself. Initially intended as a formal model of computation, Lisp evolved into a programming language as well. The individual's interest in Lisp stemmed from its power and elegance derived from its origins as a model of computation."
]
}
],
...
...
@@ -298,9 +326,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"display_name": "venv3",
"language": "python",
"name": "python3"
"name": "venv3"
},
"language_info": {
"codemirror_mode": {
...
...
%% Cell type:markdown id:8f1a9a96 tags:
<ahref="https://colab.research.google.com/github/run-llama/llama_index/blob/main/docs/examples/customization/streaming/chat_engine_condense_question_stream_response.ipynb"target="_parent"><imgsrc="https://colab.research.google.com/assets/colab-badge.svg"alt="Open In Colab"/></a>
INFO:numexpr.utils:Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
Note: NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
INFO:numexpr.utils:NumExpr defaulting to 8 threads.
NumExpr defaulting to 8 threads.
/Users/suo/miniconda3/envs/llama/lib/python3.9/site-packages/deeplake/util/check_latest_version.py:32: UserWarning: A newer version of deeplake (3.6.7) is available. It's recommended that you update to the latest version using `pip install -U deeplake`.
Paul Graham's next step in his career after his involvement with Y Combinator was to take up painting. He spent most of the rest of 2014 painting and then in March 2015 he started working on Lisp again.
Paul Graham decided to hand over Y Combinator to someone else after his time there. He asked Jessica if she wanted to be president, but she declined. Eventually, they recruited Sam Altman to take over as president. Paul Graham, along with Robert, retired from Y Combinator, while Jessica and Trevor became ordinary partners.
response_stream=chat_engine.chat("What about after that?")
response_stream=chat_engine.stream_chat("What about after that?")
```
%% Output
INFO:llama_index.chat_engine.condense_question:Querying with: What did Paul Graham do after he started working on Lisp again in March 2015?
Querying with: What did Paul Graham do after he started working on Lisp again in March 2015?
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
INFO:llama_index.core.chat_engine.condense_question:Querying with: What did Paul Graham do after handing over Y Combinator to Sam Altman and retiring from the company?
Querying with: What did Paul Graham do after handing over Y Combinator to Sam Altman and retiring from the company?
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
Paul Graham spent the rest of 2015 writing essays and working on the new dialect of Lisp he called Arc. He also looked for an apartment to buy and started to plan a second still life painting from the same objects.
After handing over Y Combinator to Sam Altman and retiring from the company, Paul Graham started his own investment firm with Jessica.
response_stream=chat_engine.chat("Can you tell me more?")
response_stream=chat_engine.stream_chat("Can you tell me more?")
```
%% Output
INFO:llama_index.chat_engine.condense_question:Querying with: What did Paul Graham do after he started working on the new dialect of Lisp he called Arc in 2015?
Querying with: What did Paul Graham do after he started working on the new dialect of Lisp he called Arc in 2015?
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
INFO:llama_index.core.chat_engine.condense_question:Querying with: Can you tell me more about Paul Graham's investment firm that he started with Jessica after retiring from Y Combinator?
Querying with: Can you tell me more about Paul Graham's investment firm that he started with Jessica after retiring from Y Combinator?
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/embeddings "HTTP/1.1 200 OK"
INFO:httpx:HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 200 OK"
Paul Graham worked on the new dialect of Lisp he called Arc for four years, from March 26, 2015 to October 12, 2019. During this time, he wrote the new Lisp, called Bel, in Arc. He also wrote essays and took his children to the coast on a sunny day in 2015. In the summer of 2016, he and his family moved to England. Finally, in the fall of 2019, he finished the project.
Paul Graham started an investment firm with Jessica after retiring from Y Combinator. They decided to create their own investment firm to implement the ideas they had been discussing. Paul funded the firm, allowing Jessica to quit her job and work for it, while also bringing on Robert and Trevor as partners. The firm was structured as an angel firm, which was a novel concept at the time. They aimed not only to make seed investments but also to provide comprehensive support to startups, similar to the help they had received when starting their own company. The investment firm was not organized as a fund and was funded with their own money. The distinctive aspect of their approach was the batch model, where they funded multiple startups at once and provided intensive support over a three-month period.
After the current situation, the narrator resumes painting and experimenting with a new kind of still life. He also resumes his old life in New York, now that he is rich. He is able to take taxis and eat in restaurants, which is exciting for a while. He also starts to connect with other people who are trying to paint in New York.
After that, the individual started working on Lisp again in March 2015. The distinctive aspect of Lisp is that its core is a language defined by writing an interpreter in itself. Initially intended as a formal model of computation, Lisp evolved into a programming language as well. The individual's interest in Lisp stemmed from its power and elegance derived from its origins as a model of computation.