Tool schema
ToolBaseSchema
Bases: ABC, BaseModel
Base schema for a Tool used in LLM.
Source code in light_agents/schemas/tool_schema.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |
run(*args, **kwargs)
abstractmethod
Python function to be executed when the tool is called.
Source code in light_agents/schemas/tool_schema.py
20 21 22 23 | |
ToolResponseSchema
Bases: BaseModel
Base schema for a Tool response used by an LLM.
Source code in light_agents/schemas/tool_schema.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | |
content: str
instance-attribute
String content to be returned by the tool to the LLM.
It can include any content or extra prompt to guide the LLM based on the tool's output.
external_fields: Optional[dict[str, Any]] = {}
class-attribute
instance-attribute
External fields to be returned for the thread.
Returns extra information and update thread fields based on the tool's output, without feeding the LLM with the content. Usefull for passing sensitive information to prevent prompt injection.
is_error: Optional[bool] = False
class-attribute
instance-attribute
Flag to indicate if the tool response is an error.