From 33da359c6d22678223a61da74841544be6ada2c7 Mon Sep 17 00:00:00 2001 From: HardAndHeavy Date: Sun, 1 Dec 2024 01:10:27 +0300 Subject: [PATCH] Remove back quotes when receiving a function response --- blueprints/function_calling_blueprint.py | 1 + 1 file changed, 1 insertion(+) diff --git a/blueprints/function_calling_blueprint.py b/blueprints/function_calling_blueprint.py index f4739b0..0390ed5 100644 --- a/blueprints/function_calling_blueprint.py +++ b/blueprints/function_calling_blueprint.py @@ -168,6 +168,7 @@ And answer according to the language of the user's question.""", response = r.json() content = response["choices"][0]["message"]["content"] + content = content[content.find('{'):content.rfind('}') + 1] # Parse the function response if content != "":