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>
pull/18872/merge
Chouaieb Nemri 2 weeks ago committed by GitHub
parent 9ec7151317
commit 8097bec472
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -346,7 +346,7 @@
"from operator import itemgetter\n",
"\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",
"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",
@ -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",
"\n",
"```python\n",
"from typing import Any, Dict, List, Optional, TypedDict\n",
"\n",
"class RunState(TypedDict):\n",
" id: str\n",
" \"\"\"ID of the run.\"\"\"\n",

Loading…
Cancel
Save