Skip to content

Commit

Permalink
use StrOutputParser in /fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dlqqq committed Jan 16, 2025
1 parent b69e2f7 commit c6cfe8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/jupyter-ai/jupyter_ai/chat_handlers/fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit c6cfe8f

Please sign in to comment.