Tool#
- class lumen.ai.tools.Tool(*, llm, memory, prompts, template_overrides, purpose, name)#
A Tool can be invoked by another Actor to provide additional context or respond to a question. Unlike an Agent they never interact with or on behalf of a user directly.
Parameters#
type: lumen.ai.llm.Llm
default: None
The LLM implementation to query.
type: lumen.ai.memory._Memory
default: None
Local memory which will be used to provide the agent context.If None the global memory will be used.
type: str
default: 'Tool'
String identifier for this object.
type: dict
default: {}
A dictionary of prompts used by the actor, indexed by prompt name.Each prompt should be defined as a dictionary containing a template’template’ and optionally a ‘model’ and ‘tools’.
type: list
default: []
List of context values it provides to current working memory.
type: str
default: ''
Describes the purpose of this actor for consumption ofother actors that might invoke it.
type: list
default: []
List of context values it requires to be in memory.
type: dict
default: {}
Overrides the template’s ‘instructions’, ‘context’, ‘tools’, or ‘examples’ jinja2 blocks.Is a nested dictionary with the prompt name (e.g. main) as the keyand the block names as the inner keys with the new content as thevalues.
Methods#
- async Tool.requirements(messages: list[Message]) list[str] #
- abstract async Tool.respond(messages: list[Message], **kwargs: dict[str, Any]) Any #
Responds to the provided messages.