From c6cfe8f305704f5147d332d52581031c0f74da62 Mon Sep 17 00:00:00 2001 From: "David L. Qiu" Date: Wed, 15 Jan 2025 15:30:01 -0800 Subject: [PATCH] use StrOutputParser in /fix --- packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py b/packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py index 390b93cf6..27ec4d024 100644 --- a/packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py +++ b/packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py @@ -3,6 +3,7 @@ from jupyter_ai.models import CellWithErrorSelection, HumanChatMessage from jupyter_ai_magics.providers import BaseProvider from langchain.prompts import PromptTemplate +from langchain_core.output_parsers import StrOutputParser from .base import BaseChatHandler, SlashCommandRoutingType @@ -76,7 +77,7 @@ def create_llm_chain( self.llm = llm prompt_template = FIX_PROMPT_TEMPLATE - runnable = prompt_template | llm # type:ignore + runnable = prompt_template | llm | StrOutputParser() # type:ignore self.llm_chain = runnable async def process_message(self, message: HumanChatMessage):