From bcfa711be42539c3fcf8efb0ca336254a7b0d05e Mon Sep 17 00:00:00 2001 From: moes-91 Date: Tue, 17 Dec 2024 08:22:40 +0100 Subject: [PATCH] fix: crash when no tools are given (no conditional tool_choice) chore: bump to v0.0.6 --- pyproject.toml | 2 +- src/xai_grok_sdk/xai.py | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index b3f4d0e..b9d8059 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "xai-grok-sdk" -version = "0.0.5" +version = "0.0.6" description = "Lightweight xAI SDK with minimal dependencies" dependencies = [ "requests>=2.32.3", diff --git a/src/xai_grok_sdk/xai.py b/src/xai_grok_sdk/xai.py index a0c5f7c..8d47036 100644 --- a/src/xai_grok_sdk/xai.py +++ b/src/xai_grok_sdk/xai.py @@ -114,7 +114,6 @@ def invoke( payload = { "model": self.model, "messages": messages, - "tool_choice": tool_choice, } # Add optional parameters if they differ from defaults @@ -152,7 +151,7 @@ def invoke( # Include tools if configured if len(self.tools) > 0: payload["tools"] = self.tools - + payload["tool_choice"] = tool_choice # Make API call response_data = self._make_api_call(payload)