From 1f703e94387ea242476c3e071b1fb2fadd63ea9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tuana=20=C3=87elik?= Date: Tue, 18 Jun 2024 12:20:09 +0200 Subject: [PATCH] Update haystack_experimental/components/tools/openai/function_caller.py Co-authored-by: Massimiliano Pippi --- .../components/tools/openai/function_caller.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/haystack_experimental/components/tools/openai/function_caller.py b/haystack_experimental/components/tools/openai/function_caller.py index 339b8a97..c4d00b72 100644 --- a/haystack_experimental/components/tools/openai/function_caller.py +++ b/haystack_experimental/components/tools/openai/function_caller.py @@ -61,7 +61,8 @@ def from_dict(cls, data: Dict[str, Any]) -> "OpenAIFunctionCaller": available_functions = {} for name, path in available_function_paths.items(): available_functions[name] = deserialize_callable(path) - return cls(available_functions) + data["init_parameters"]["available_functions"] = available_functions + return default_to_dict(cls, data) @component.output_types(function_replies=List[ChatMessage], assistant_replies=List[ChatMessage]) def run(self, messages: List[ChatMessage]):