lagent.actions

Submodules

Package Contents

Functions

list_tools([with_class])

List available tools

get_tool_cls(specifier)

Get the action class

get_tool(specifier, *args, **kwargs)

Instantiate an action

lagent.actions.list_tools(with_class=False)

List available tools

Parameters:

with_class (bool) – whether to return the action class along with its name. Defaults to False.

Returns:

all action names

Return type:

list

lagent.actions.get_tool_cls(specifier)

Get the action class

Parameters:

specifier (str) – tool name

Returns:

action class

Return type:

Type[BaseAction]

lagent.actions.get_tool(specifier, *args, **kwargs)

Instantiate an action

Parameters:
  • specifier (str) – tool name

  • args – positional arguments passed to the action’s __init__ method

  • kwargs – keyword arguments passed to the action’s __init__ method

Returns:

action object

Return type:

BaseAction