Skip to main content

LensStudio:ChatTool.IChatToolRegistry

Class

Interface for registering and discovering ChatTool instances within the plugin system.

Index

Example

const ChatTool = await import('LensStudio:ChatTool');
const registry = this.pluginSystem.findInterface(
ChatTool.IChatToolRegistry
) as import('LensStudio:ChatTool').IChatToolRegistry;
const tools = registry.tools;
console.log(`Registered ChatTools: ${tools.length}`);
for (const tool of tools) {
console.log(` tool: ${tool.name} (${tool.id})`);
}
this.connections.push(
registry.toolRegistered.connect((descriptor) => {
console.log(`ChatTool registered: ${descriptor.name}`);
})
);

Extends

Properties

interfaceId

static interfaceId: InterfaceId

Unique identifier used to look up this interface via the plugin system.


toolDeregistered

readonly toolDeregistered: signal1<IPluginDescriptor, void>

Signal emitted when a chat tool plugin is unregistered from the registry.


toolRegistered

readonly toolRegistered: signal1<IPluginDescriptor, void>

Signal emitted when a new chat tool plugin is registered.


tools

readonly tools: IPluginDescriptor[]

Array of all currently registered chat tool plugin descriptors.

Methods

execute()

execute(descriptor, parameters): Promise<Result>

Execute a registered chat tool by its plugin descriptor with the given parameters.

Parameters

ParameterType
descriptorIPluginDescriptor
parametersParameters

Returns

Promise<Result>


getTypeName()

static getTypeName(): string

Returns the type name of this class.

Returns

string

Overrides

IPluginComponent.getTypeName


getTypeName()

getTypeName(): string

Returns the name of this object's type.

Returns

string

Inherited from

IPluginComponent.getTypeName


isOfType()

isOfType(type): boolean

Returns true if the object is of the specified type.

Parameters

ParameterType
typestring

Returns

boolean

Inherited from

IPluginComponent.isOfType


isSame()

isSame(other): boolean

Returns true if this object refers to the same instance as the given object.

Parameters

ParameterType
otherScriptObject

Returns

boolean

Inherited from

IPluginComponent.isSame