Siren AI scripting API reference

Classes

GenerativeAi

Generative AI class. Accessible via sirenapi.extensions.GenerativeAi

Methods

generateGraphReport()
static generateGraphReport(graphModel, options?): Promise<{
  content: string;
}>

Generate a report from a graph model

Parameters
Parameter Type Description

graphModel

GraphModel

The graph model to generate a report from. Retrieved from the graphBrowserVis.getGraphModel()

options?

{ focusNodes: string[]; }

Additional options

options.focusNodes?

string[]

The IDs of the nodes to focus on in the report

Returns

Promise<{ content: string; }>

  • The generated report content in Markdown format

Example
const graphVis = await sirenapi.Visualization.getCurrentVisualizer()
const graphModel = graphVis.getGraphModel()
await sirenapi.extensions.GenerativeAi.generateGraphReport(graphModel)
sendPrompt()
static sendPrompt(message, options?): Promise<{
  contextId: string;
  data: Message;
}>

Send a prompt to the AI

Parameters
Parameter Type Description

message

string

The message to send to the AI

options?

{ contextId: string; }

Additional options

options.contextId?

string

The ID of the conversation context; helps the LLM remember previous messages

Returns

Promise<{ contextId: string; data: Message; }>

  • The response from the LLM

Example
await sirenapi.extensions.GenerativeAi.sendPrompt('What is 2 * 4?')