From 9930c1306278f1fe155d71f31efd8973c6721056 Mon Sep 17 00:00:00 2001 From: mmikita95 Date: Wed, 4 Dec 2024 12:25:28 +0300 Subject: [PATCH] fix: edge case of callable entry not being retrieved --- src/writer/ai.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/writer/ai.py b/src/writer/ai.py index f045f03c5..bbdbbfbb8 100644 --- a/src/writer/ai.py +++ b/src/writer/ai.py @@ -1546,6 +1546,11 @@ def _convert_argument_to_type(self, value: Any, target_type: str) -> Any: def _check_if_arguments_are_required(self, function_name: str) -> bool: callable_entry = self._callable_registry.get(function_name) + if not callable_entry: + raise RuntimeError( + f"Tried to check arguments of function {function_name} " + + "which is not present in the conversation's callable registry." + ) callable_parameters = callable_entry.get("parameters") return \ callable_parameters is not None \