From e1b6e50c6689e544f7c31e6d79eb05c526e4ad53 Mon Sep 17 00:00:00 2001 From: Shroominic Date: Sun, 8 Oct 2023 14:00:52 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Improved=20error=20handling=20me?= =?UTF-8?q?ssage?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- funcchain/parser.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/funcchain/parser.py b/funcchain/parser.py index aacca6b..8a43acc 100644 --- a/funcchain/parser.py +++ b/funcchain/parser.py @@ -63,8 +63,8 @@ def _pre_parse_function_call(self, result: list[Generation]) -> dict: message = generation.message try: func_call = copy.deepcopy(message.additional_kwargs["function_call"]) - except KeyError as exc: - raise OutputParserException(f"Could not parse function call: {exc}") + except KeyError: + raise OutputParserException(f"The model refused to respond with a function call:\n{message.content}\n\n") return func_call