@camera.ui/sdk / plugin / defineAssistantTool
Function: defineAssistantTool() ​
defineAssistantTool<
T>(spec):T
Defined in: plugin/assistant.ts:193
Identity helper that keeps the literal types of a tool spec, so a typo in a property type is a compile error instead of a runtime surprise.
Type Parameters ​
T ​
T extends AssistantToolSpec
Parameters ​
spec ​
T
The tool spec.
Returns ​
T
The same spec, unchanged.
Example ​
ts
const setFavorite = defineAssistantTool({
name: 'set_favorite',
description: 'Mark or unmark a recorded event as favorite.',
inputSchema: { type: 'object', properties: { eventId: { type: 'string' }, favorite: { type: 'boolean' } }, required: ['eventId', 'favorite'] },
approval: true,
});