mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 23:54:14 +00:00
Added LogEntry, Any, Dict, List, Optional, TypedDict imports (#20970)
Thank you for contributing to LangChain! - [ ] **PR title**: "package: docs" - [ ] **PR message**: - **Description:** Uptaded docs: Rag streaming use-cases notebook with LogEntry, Any, Dict, List, Optional, TypedDict imports - **Twitter handle:** c_nemri --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
9ec7151317
commit
8097bec472
@ -346,7 +346,7 @@
|
|||||||
"from operator import itemgetter\n",
|
"from operator import itemgetter\n",
|
||||||
"\n",
|
"\n",
|
||||||
"from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\n",
|
"from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder\n",
|
||||||
"from langchain_core.tracers.log_stream import LogStreamCallbackHandler\n",
|
"from langchain_core.tracers.log_stream import LogEntry, LogStreamCallbackHandler\n",
|
||||||
"\n",
|
"\n",
|
||||||
"contextualize_q_system_prompt = \"\"\"Given a chat history and the latest user question \\\n",
|
"contextualize_q_system_prompt = \"\"\"Given a chat history and the latest user question \\\n",
|
||||||
"which might reference context in the chat history, formulate a standalone question \\\n",
|
"which might reference context in the chat history, formulate a standalone question \\\n",
|
||||||
@ -400,6 +400,8 @@
|
|||||||
"To stream intermediate steps we'll use the `astream_log` method. This is an async method that yields JSONPatch ops that when applied in the same order as received build up the RunState:\n",
|
"To stream intermediate steps we'll use the `astream_log` method. This is an async method that yields JSONPatch ops that when applied in the same order as received build up the RunState:\n",
|
||||||
"\n",
|
"\n",
|
||||||
"```python\n",
|
"```python\n",
|
||||||
|
"from typing import Any, Dict, List, Optional, TypedDict\n",
|
||||||
|
"\n",
|
||||||
"class RunState(TypedDict):\n",
|
"class RunState(TypedDict):\n",
|
||||||
" id: str\n",
|
" id: str\n",
|
||||||
" \"\"\"ID of the run.\"\"\"\n",
|
" \"\"\"ID of the run.\"\"\"\n",
|
||||||
|
Loading…
Reference in New Issue
Block a user