From 94db8a938d13a903521d942fa1cd2589627eccb8 Mon Sep 17 00:00:00 2001 From: Matteo Dora Date: Thu, 26 Oct 2023 12:14:52 +0200 Subject: [PATCH] Code style --- giskard/llm/client.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/giskard/llm/client.py b/giskard/llm/client.py index 244f2dd46b..6305f0e7bd 100644 --- a/giskard/llm/client.py +++ b/giskard/llm/client.py @@ -116,6 +116,8 @@ def complete( max_tokens=max_tokens, ) + function_call = None + if fc := cc.get("function_call"): try: function_call = LLMFunctionCall( @@ -124,8 +126,6 @@ def complete( ) except (json.JSONDecodeError, KeyError) as err: raise LLMGenerationError("Could not parse function call") from err - else: - function_call = None return LLMOutput(message=cc.content, function_call=function_call)