camel icon indicating copy to clipboard operation
camel copied to clipboard

[BUG] All tools donot work successfully.

Open monicazgr1 opened this issue 8 months ago • 2 comments

Required prerequisites

What version of camel are you using?

0.2.44

System information

3.11.0 | packaged by Anaconda, Inc. | (main, Mar 1 2023, 18:18:21) [MSC v.1916 64 bit (AMD64)] win32 0.2.44

Problem description

I used the provided examples to execute, however, all the result donot use the tools. The response does not use the tools. In the output of the codes: 'tool_calls': [].

Reproducible example code

The Code:

from camel.models import ModelFactory
from camel.types import ModelPlatformType, ModelType
from camel.agents import ChatAgent
from camel.toolkits import SearchToolkit
from camel.toolkits import GithubToolkit
import os
# from dotenv import load_dotenv
# load_dotenv()


os.environ["Siliconflow_API_KEY"] = "sk-******************************"

# Siliconflow_API_KEY = os.getenv("Siliconflow_API_KEY")

# set GOOGLE_API_KEY = "AIzaSyAtv2gvuT7X8j8Lvu18nawh7pcbl3pcN9w
model = ModelFactory.create(
  model_platform=ModelPlatformType.SILICONFLOW,
  model_type=ModelType.SILICONFLOW_QWEN2_5_32B_INSTRUCT,
  model_config_dict={"temperature": 0.0},
  api_key= os.getenv("Siliconflow_API_KEY"),
#   url="https://api.siliconflow.cn/v1/chat/completions"
)

# search_tool = SearchToolkit().search_duckduckgo
# github_tool = GithubToolkit().
search_tool = SearchToolkit().search_wiki

agent = ChatAgent(model=model, tools=[search_tool])

response_1 = agent.step("What is CAMEL-AI?")
print('000000', response_1)
print(response_1.msgs[0].content)
# CAMEL-AI is the first LLM (Large Language Model) multi-agent framework
# and an open-source community focused on finding the scaling laws of agents.
# ...

response_2 = agent.step("What is the Github link to CAMEL framework?")
print('222', response_2.msgs[0])
print(response_2.msgs[0].content)
# The GitHub link to the CAMEL framework is
# [https://github.com/camel-ai/camel](https://github.com/camel-ai/camel).

### Traceback

```pytb
D:\Anaconda3\envs\camel\Lib\site-packages\camel\toolkits\function_tool.py:461: UserWarning: Parameter description is missing for
                            {'enum': ['searchResults', 'sourcedAnswer', 'structured'], 'type': 'string'}. This may affect the quality of tool
                            calling.
  warnings.warn(f"""Parameter description is missing for
000000 msgs=[BaseMessage(role_name='assistant', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={}, content='CAMEL-AI is not a widely recognized term or acronym in the field of artificial intelligence as of my last update. It\'s possible that you might be referring to a specific project, model, or concept that is not broadly known or is relatively new. If CAMEL-AI is related to a specific context, such as a research project, a company\'s internal naming convention, or a particular application of AI, more details would be needed to provide an accurate explanation.\n\nIf you have additional context or details about where you encountered the term "CAMEL-AI," please share them, and I can provide a more precise answer.', video_bytes=None, image_list=None, image_detail='auto', video_detail='low', parsed=None)] terminated=False info={'id': '01963704d4219583d5d7b98497bc0704', 'usage': {'completion_tokens': 129, 'prompt_tokens': 37, 'total_tokens': 166, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'termination_reasons': ['stop'], 'num_tokens': 14, 'tool_calls': [], 'external_tool_call_requests': None}
CAMEL-AI is not a widely recognized term or acronym in the field of artificial intelligence as of my last update. It's possible that you might be referring to a specific project, model, or concept that is not broadly known or is relatively new. If CAMEL-AI is related to a specific context, such as a research project, a company's internal naming convention, or a particular application of AI, more details would be needed to provide an accurate explanation.

If you have additional context or details about where you encountered the term "CAMEL-AI," please share them, and I can provide a more precise answer.
222 BaseMessage(role_name='assistant', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={}, content=' If CAMEL-AI is indeed a project or framework that has a presence on GitHub, providing the exact name or more details would help in locating the correct repository. As of now, without more specific information, I cannot provide a direct GitHub link to a CAMEL framework.', video_bytes=None, image_list=None, image_detail='auto', video_detail='low', parsed=None)
 If CAMEL-AI is indeed a project or framework that has a presence on GitHub, providing the exact name or more details would help in locating the correct repository. As of now, without more specific information, I cannot provide a direct GitHub link to a CAMEL framework.
### Expected behavior

_No response_

### Additional context

_No response_

monicazgr1 avatar Apr 15 '25 01:04 monicazgr1

hi @monicazgr1 can you escape the code between backticks?

JINO-ROHIT avatar Apr 15 '25 06:04 JINO-ROHIT

is the issue on both the responses?

JINO-ROHIT avatar Apr 15 '25 06:04 JINO-ROHIT

test with provided code using camel 0.2.51, the tool call works as expected

msgs=[BaseMessage(role_name='assistant', role_type=<RoleType.ASSISTANT: 'assistant'>, meta_dict={}, content='It seems there\'s no direct Wikipedia page for "CAMEL-AI". Could you provide more context or specify if it\'s related to a specific field like technology, a company, or an acronym? This will help me find more accurate information.', video_bytes=None, image_list=None, image_detail='auto', video_detail='low', parsed=None)] terminated=False info={'id': '019696fc390fdeb280bb788774b5b2b2', 'usage': {'completion_tokens': 50, 'prompt_tokens': 284, 'total_tokens': 334, 'completion_tokens_details': None, 'prompt_tokens_details': None}, 'termination_reasons': ['stop'], 'num_tokens': 71, 'tool_calls': [ToolCallingRecord(tool_name='search_wiki', args={'entity': 'CAMEL-AI'}, result='There is no page in Wikipedia corresponding to entity CAMEL-AI, please specify another word to describe the entity to be searched.', tool_call_id='019696fc2ea1e6acf5eb3307b041c996')], 'external_tool_call_requests': None}

I will close this issue, free feel to reopen if you have any further questions

Wendong-Fan avatar May 03 '25 16:05 Wendong-Fan