Class AIConnectorHandler
java.lang.Object
org.eclipse.lemminx.customservice.synapse.mediatorService.AIConnectorHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerateAgentToolConfig(String documentUri, org.eclipse.lsp4j.Range range, String mediator, Map<String, Object> data, List<String> dirtyFields, boolean isUpdate) Generates the AI agent tool configuration.generateAIConnectorConfig(STNode node, String mediator, Map<String, Object> data, org.eclipse.lsp4j.Range range) Generates the AI agent operation configuration.com.google.gson.JsonObjectgetToolSchema(String mediatorName) Retrieves the schema for the specified mediator to use as a tool.com.google.gson.JsonObjectgetToolSchemaWithValues(DOMDocument document, org.eclipse.lsp4j.Position position) Retrieves the ui schema with current values for the agent tool at the given position.static StringsanitizeToolName(String input)
-
Constructor Details
-
AIConnectorHandler
-
-
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 otherwisemediator- mediator namedata- agent operation form datarange- 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, BadLocationExceptionGenerates the AI agent tool configuration.- Parameters:
documentUri- current document URIrange- range where the tool need to be added or updatedmediator- mediator namedata- the tool form datadirtyFields- list of fields that have been modifiedisUpdate- 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 templateBadLocationException- if the given range is invalid/ out of bounds
-
sanitizeToolName
-
getToolSchema
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 documentposition- position of the tool- Returns:
- the schema with current values
-