java.lang.Object
org.eclipse.lemminx.customservice.synapse.mediatorService.AIConnectorHandler

public class AIConnectorHandler extends Object
  • Constructor Details

  • Method Details

    • generateAIConnectorConfig

      public SynapseConfigResponse generateAIConnectorConfig(STNode node, String mediator, Map<String,Object> data, org.eclipse.lsp4j.Range range)
      Generates the AI agent operation configuration.
      Parameters:
      node - syntax tree node for the current position if it is an edit operation, null otherwise
      mediator - mediator name
      data - agent operation form data
      range - range where the agent operation need to be added or updated
      Returns:
      the generated configuration response
    • generateAgentToolConfig

      public SynapseConfigResponse generateAgentToolConfig(String documentUri, org.eclipse.lsp4j.Range range, String mediator, Map<String,Object> data, List<String> dirtyFields, boolean isUpdate) throws IOException, BadLocationException
      Generates the AI agent tool configuration.
      Parameters:
      documentUri - current document URI
      range - range where the tool need to be added or updated
      mediator - mediator name
      data - the tool form data
      dirtyFields - list of fields that have been modified
      isUpdate - true if it is an update operation, false otherwise
      Returns:
      the generated configuration response
      Throws:
      IOException - if an error occurs while reading the current document/sequence template
      BadLocationException - if the given range is invalid/ out of bounds
    • sanitizeToolName

      public static String sanitizeToolName(String input)
    • getToolSchema

      public com.google.gson.JsonObject getToolSchema(String mediatorName)
      Retrieves the schema for the specified mediator to use as a tool.
      Parameters:
      mediatorName - the name of the mediator
      Returns:
      the schema as a JsonObject
    • getToolSchemaWithValues

      public com.google.gson.JsonObject getToolSchemaWithValues(DOMDocument document, org.eclipse.lsp4j.Position position)
      Retrieves the ui schema with current values for the agent tool at the given position.
      Parameters:
      document - current document
      position - position of the tool
      Returns:
      the schema with current values