From 447a523662cc362190d70acf6d28d5001e738458 Mon Sep 17 00:00:00 2001 From: Stephen Hankinson Date: Mon, 9 Oct 2023 18:55:44 -0300 Subject: [PATCH] fix comments in output format (#11536) - **Description:** Fixes the comments in the ConvoOutputParser. Because the \\\\ is escaping a single \\, they render something like: `"action_input": string \ The input to the action` in the prompt. Changing this to \\\\\\\\ lets it escape two slashes so that it renders a proper comment: `"action_input": string \\ The input to the action` - **Issue:** N/A - **Dependencies:** - **Tag maintainer:** @hwchase17 - **Twitter handle:** --- .../langchain/agents/conversational_chat/prompt.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langchain/langchain/agents/conversational_chat/prompt.py b/libs/langchain/langchain/agents/conversational_chat/prompt.py index 3d1799ac3d..712a9238ea 100644 --- a/libs/langchain/langchain/agents/conversational_chat/prompt.py +++ b/libs/langchain/langchain/agents/conversational_chat/prompt.py @@ -18,8 +18,8 @@ Markdown code snippet formatted in the following schema: ```json {{{{ - "action": string, \\ The action to take. Must be one of {tool_names} - "action_input": string \\ The input to the action + "action": string, \\\\ The action to take. Must be one of {tool_names} + "action_input": string \\\\ The input to the action }}}} ``` @@ -29,7 +29,7 @@ Use this if you want to respond directly to the human. Markdown code snippet for ```json {{{{ "action": "Final Answer", - "action_input": string \\ You should put what you want to return to use here + "action_input": string \\\\ You should put what you want to return to use here }}}} ```"""