Skip to content

@graphty/graphty-element / ai / GraphCommand

Interface: GraphCommand ​

Defined in: graphty-element/src/ai/commands/types.ts:76

Definition of a graph command that can be executed via AI.

Properties ​

description ​

readonly description: string

Defined in: graphty-element/src/ai/commands/types.ts:80

Description of what the command does (used in LLM prompt)


examples ​

readonly examples: CommandExample[]

Defined in: graphty-element/src/ai/commands/types.ts:84

Examples of how the command can be invoked


name ​

readonly name: string

Defined in: graphty-element/src/ai/commands/types.ts:78

Unique name of the command (used as tool name)


parameters ​

readonly parameters: ZodType

Defined in: graphty-element/src/ai/commands/types.ts:82

Zod schema defining the parameters

Methods ​

execute() ​

execute(graph, params, context?): Promise<CommandResult>

Defined in: graphty-element/src/ai/commands/types.ts:92

Execute the command.

Parameters ​

graph ​

Graph

The graph instance to operate on

params ​

Record<string, unknown>

Parameters parsed from user input

context? ​

CommandContext

Optional execution context with abort signal and event emitter

Returns ​

Promise<CommandResult>

Promise resolving to the command result