camel.agents.tool_agents package#

Submodules#

camel.agents.tool_agents.base module#

class camel.agents.tool_agents.base.BaseToolAgent(name: str, description: str)[source]#

Bases: BaseAgent

Creates a BaseToolAgent object with the specified name and

description.

Parameters:
  • name (str) – The name of the tool agent.

  • description (str) – The description of the tool agent.

reset() None[source]#

Resets the agent to its initial state.

step() None[source]#

Performs a single step of the agent.

camel.agents.tool_agents.hugging_face_tool_agent module#

class camel.agents.tool_agents.hugging_face_tool_agent.HuggingFaceToolAgent(name: str, *args: Any, remote: bool = True, **kwargs: Any)[source]#

Bases: BaseToolAgent

Tool agent for calling HuggingFace models. This agent is a wrapper

around agents from the transformers library. For more information about the available models, please see the transformers documentation at https://huggingface.co/docs/transformers/transformers_agents.

Parameters:
  • name (str) – The name of the agent.

  • *args (Any) – Additional positional arguments to pass to the underlying Agent class.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. (default: True)

  • **kwargs (Any) – Additional keyword arguments to pass to the underlying Agent class.

chat(*args: Any, remote: bool | None = None, **kwargs: Any) Any[source]#

Runs the agent in a chat conversation mode.

Parameters:
  • *args (Any) – Positional arguments to pass to the agent.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. Overrides the default setting. (default: None)

  • **kwargs (Any) – Keyword arguments to pass to the agent.

Returns:

The response from the agent.

Return type:

str

reset() None[source]#

Resets the chat history of the agent.

step(*args: Any, remote: bool | None = None, **kwargs: Any) Any[source]#

Runs the agent in single execution mode.

Parameters:
  • *args (Any) – Positional arguments to pass to the agent.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. Overrides the default setting. (default: None)

  • **kwargs (Any) – Keyword arguments to pass to the agent.

Returns:

The response from the agent.

Return type:

str

Module contents#

class camel.agents.tool_agents.BaseToolAgent(name: str, description: str)[source]#

Bases: BaseAgent

Creates a BaseToolAgent object with the specified name and

description.

Parameters:
  • name (str) – The name of the tool agent.

  • description (str) – The description of the tool agent.

reset() None[source]#

Resets the agent to its initial state.

step() None[source]#

Performs a single step of the agent.

class camel.agents.tool_agents.HuggingFaceToolAgent(name: str, *args: Any, remote: bool = True, **kwargs: Any)[source]#

Bases: BaseToolAgent

Tool agent for calling HuggingFace models. This agent is a wrapper

around agents from the transformers library. For more information about the available models, please see the transformers documentation at https://huggingface.co/docs/transformers/transformers_agents.

Parameters:
  • name (str) – The name of the agent.

  • *args (Any) – Additional positional arguments to pass to the underlying Agent class.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. (default: True)

  • **kwargs (Any) – Additional keyword arguments to pass to the underlying Agent class.

chat(*args: Any, remote: bool | None = None, **kwargs: Any) Any[source]#

Runs the agent in a chat conversation mode.

Parameters:
  • *args (Any) – Positional arguments to pass to the agent.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. Overrides the default setting. (default: None)

  • **kwargs (Any) – Keyword arguments to pass to the agent.

Returns:

The response from the agent.

Return type:

str

reset() None[source]#

Resets the chat history of the agent.

step(*args: Any, remote: bool | None = None, **kwargs: Any) Any[source]#

Runs the agent in single execution mode.

Parameters:
  • *args (Any) – Positional arguments to pass to the agent.

  • remote (bool, optional) – Flag indicating whether to run the agent remotely. Overrides the default setting. (default: None)

  • **kwargs (Any) – Keyword arguments to pass to the agent.

Returns:

The response from the agent.

Return type:

str