Commit 7c1c8c0 1 parent 7cbc340 commit 7c1c8c0 Copy full SHA for 7c1c8c0
File tree 2 files changed +3
-2
lines changed
packages/jupyter-ai/jupyter_ai/chat_handlers
2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -492,7 +492,7 @@ def create_llm_chain(
492
492
prompt_template = FIX_PROMPT_TEMPLATE
493
493
self .prompt_template = prompt_template
494
494
495
- runnable = prompt_template | llm # type: ignore
495
+ runnable = prompt_template | llm | StrOutputParser() # type: ignore
496
496
self .llm_chain = runnable
497
497
```
498
498
Original file line number Diff line number Diff line change 3
3
4
4
from jupyter_ai_magics .providers import BaseProvider
5
5
from jupyterlab_chat .models import Message
6
+ from langchain_core .output_parsers import StrOutputParser
6
7
from langchain_core .runnables .history import RunnableWithMessageHistory
7
8
8
9
from ..context_providers import ContextProviderException , find_commands
@@ -36,7 +37,7 @@ def create_llm_chain(
36
37
self .llm = llm
37
38
self .prompt_template = prompt_template
38
39
39
- runnable = prompt_template | llm # type:ignore
40
+ runnable = prompt_template | llm | StrOutputParser () # type:ignore
40
41
if not llm .manages_history :
41
42
runnable = RunnableWithMessageHistory (
42
43
runnable = runnable , # type:ignore[arg-type]
You can’t perform that action at this time.
0 commit comments