From 4511f0db60e86f96cc009e34de6e2cd830afdd3a Mon Sep 17 00:00:00 2001 From: Musa Khan Date: Fri, 29 Nov 2024 23:19:54 +0000 Subject: [PATCH] fix: removed redundent condition in GeminiTool.tool_schema --- mirascope/core/gemini/tool.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mirascope/core/gemini/tool.py b/mirascope/core/gemini/tool.py index 805928a04..86599300e 100644 --- a/mirascope/core/gemini/tool.py +++ b/mirascope/core/gemini/tool.py @@ -65,10 +65,10 @@ def format_book(title: str, author: str) -> str: """ model_schema = cls.model_json_schema() fn: dict[str, Any] = {"name": cls._name(), "description": cls._description()} + if model_schema["properties"]: fn["parameters"] = model_schema - if model_schema["required"]: - fn["parameters"]["required"] = model_schema["required"] + if "parameters" in fn: if "$defs" in fn["parameters"]: raise ValueError(