Skip to content

armgit / camel

Public Imported from GitHub
0

🐫 CAMEL: The first and the best multi-agent framework. Finding the Scaling Law of Agents. https://www.camel-ai.org

chore: add error rasing for gemini tool call with response format (#2363)

Wendong-Fan19b6cea02975
diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml
index 83dd8feb7..a0d53c9df 100644
--- a/.github/ISSUE_TEMPLATE/bug_report.yml
+++ b/.github/ISSUE_TEMPLATE/bug_report.yml
@@ -26,7 +26,7 @@ body:
attributes:
label: What version of camel are you using?
description: Run command `python3 -c 'print(__import__("camel").__version__)'` in your shell and paste the output here.
- placeholder: E.g., 0.2.56
+ placeholder: E.g., 0.2.57
validations:
required: true
diff --git a/camel/__init__.py b/camel/__init__.py
index 840399d63..ead21cbdf 100644
--- a/camel/__init__.py
+++ b/camel/__init__.py
@@ -14,7 +14,7 @@
from camel.logger import disable_logging, enable_logging, set_log_level
-__version__ = '0.2.56'
+__version__ = '0.2.57'
__all__ = [
'__version__',
diff --git a/camel/models/gemini_model.py b/camel/models/gemini_model.py
index 5a643caa1..e637c985e 100644
--- a/camel/models/gemini_model.py
+++ b/camel/models/gemini_model.py
@@ -125,6 +125,11 @@ class GeminiModel(OpenAICompatibleModel):
)
messages = self._process_messages(messages)
if response_format:
+ if tools:
+ raise ValueError(
+ "Gemini does not support function calling with "
+ "response format."
+ )
return self._request_parse(messages, response_format)
else:
return self._request_chat_completion(messages, tools)
@@ -155,6 +160,11 @@ class GeminiModel(OpenAICompatibleModel):
)
messages = self._process_messages(messages)
if response_format:
+ if tools:
+ raise ValueError(
+ "Gemini does not support function calling with "
+ "response format."
+ )
return await self._arequest_parse(messages, response_format)
else:
return await self._arequest_chat_completion(messages, tools)
diff --git a/docs/conf.py b/docs/conf.py
index 79ee37152..6ca7bed6b 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -27,7 +27,7 @@ sys.path.insert(0, os.path.abspath('..'))
project = 'CAMEL'
copyright = '2024, CAMEL-AI.org'
author = 'CAMEL-AI.org'
-release = '0.2.56'
+release = '0.2.57'
html_favicon = (
'https://raw.githubusercontent.com/camel-ai/camel/master/misc/favicon.png'
diff --git a/docs/key_modules/loaders.md b/docs/key_modules/loaders.md
index 37ef94325..dcdd1c0a0 100644
--- a/docs/key_modules/loaders.md
+++ b/docs/key_modules/loaders.md
@@ -340,14 +340,14 @@ response = jina_reader.read_content("https://docs.camel-ai.org/")
print(response)
```
```markdown
->>>Welcome to CAMEL’s documentation! — CAMEL 0.2.56 documentation
+>>>Welcome to CAMEL’s documentation! — CAMEL 0.2.57 documentation
===============
[Skip to main content](https://docs.camel-ai.org/#main-content)
Back to top Ctrl+K
- [![Image 1](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png) ![Image 2](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png)CAMEL 0.2.56](https://docs.camel-ai.org/#)
+ [![Image 1](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png) ![Image 2](https://raw.githubusercontent.com/camel-ai/camel/master/misc/logo_light.png)CAMEL 0.2.57](https://docs.camel-ai.org/#)
Search Ctrl+K
diff --git a/pyproject.toml b/pyproject.toml
index 2d453bc63..fe4aa1a18 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "camel-ai"
-version = "0.2.56"
+version = "0.2.57"
description = "Communicative Agents for AI Society Study"
authors = [{ name = "CAMEL-AI.org" }]
requires-python = ">=3.10,<3.13"
diff --git a/uv.lock b/uv.lock
index e6e88c5c9..6ada66245 100644
--- a/uv.lock
+++ b/uv.lock
@@ -555,7 +555,7 @@ wheels = [
[[package]]
name = "camel-ai"
-version = "0.2.56"
+version = "0.2.57"
source = { editable = "." }
dependencies = [
{ name = "colorama" },