AI Tool
Updated
A script with functions the agent can call.
- Type
comp-ai-tool- Script class
AIToolComponent- Per entity
- Several
- Version
- 1.0.0
Read about it in Tools: what it does, how to use it from a script, and examples.
Live example
Section titled “Live example”Run it in the browser, read its scripts, and download it as an XR Creator project.
Live example
List an agent's toolsA script lists an AI agent's tools at startup: each AI Tool's label, how many tools its script declares and whether it is switched on.
Read the tool list in the log. No conversation is started, so the example needs no AI service.
From a script
Section titled “From a script”#pragma lifecycle(startup)
function startup() { const component = self.parent.getComponent(AIToolComponent); if (component) log(component.props);}