From 8097bec4723dbe6afe91fe933a3800c526da7ec5 Mon Sep 17 00:00:00 2001 From: Chouaieb Nemri Date: Sat, 27 Apr 2024 22:13:54 +0200 Subject: [PATCH] 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 --- docs/docs/use_cases/question_answering/streaming.ipynb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/docs/use_cases/question_answering/streaming.ipynb b/docs/docs/use_cases/question_answering/streaming.ipynb index 975316bdc59..e12a0cb7214 100644 --- a/docs/docs/use_cases/question_answering/streaming.ipynb +++ b/docs/docs/use_cases/question_answering/streaming.ipynb @@ -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",