HuggingFaceToolAgent

class HuggingFaceToolAgent(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: :obj:True) **kwargs (Any): Additional keyword arguments to pass to the underlying Agent class.

init

def __init__(
    self,
    name: str,
    *args: Any,
    **kwargs: Any
):

reset

def reset(self):

Resets the chat history of the agent.

step

def step(self, *args: Any, **kwargs: Any):

Runs the agent in single execution mode.

Parameters:

  • remote (bool, optional): Flag indicating whether to run the agent remotely. Overrides the default setting. (default: :obj:None) **kwargs (Any): Keyword arguments to pass to the agent.

Returns:

str: The response from the agent.

chat

def chat(self, *args: Any, **kwargs: Any):

Runs the agent in a chat conversation mode.

Parameters:

  • remote (bool, optional): Flag indicating whether to run the agent remotely. Overrides the default setting. (default: :obj:None) **kwargs (Any): Keyword arguments to pass to the agent.

Returns:

str: The response from the agent.