From 92eb9ee90e8aadf8cd4763edda00bd0a515ec8cd Mon Sep 17 00:00:00 2001 From: SatyamSah5 Date: Wed, 10 Sep 2025 10:26:40 +0530 Subject: [PATCH] made ai endpoint url configurable and renamed bean to ai action --- .../repo/action/executer/AISummaryActionExecuter.java | 10 ++++++++-- .../resources/alfresco/action-services-context.xml | 3 ++- .../src/main/resources/alfresco/repository.properties | 3 +++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/repository/src/main/java/org/alfresco/repo/action/executer/AISummaryActionExecuter.java b/repository/src/main/java/org/alfresco/repo/action/executer/AISummaryActionExecuter.java index 671f580ebe..55d1312247 100644 --- a/repository/src/main/java/org/alfresco/repo/action/executer/AISummaryActionExecuter.java +++ b/repository/src/main/java/org/alfresco/repo/action/executer/AISummaryActionExecuter.java @@ -47,8 +47,9 @@ import org.alfresco.service.namespace.QName; public class AISummaryActionExecuter extends ActionExecuterAbstractBase { - public static final String NAME = "ai-summary"; + public static final String NAME = "ai-action"; private static final String TARGET_MIMETYPE = "text/plain"; + private String AI_ENDPOINT_URL; private DictionaryService dictionaryService; private ContentService contentService; @@ -81,6 +82,11 @@ public class AISummaryActionExecuter extends ActionExecuterAbstractBase this.converter = converter; } + public void setAI_ENDPOINT_URL(String aiUrl) + { + this.AI_ENDPOINT_URL = aiUrl; + } + @Override protected void addParameterDefinitions(List paramList) { @@ -169,7 +175,7 @@ public class AISummaryActionExecuter extends ActionExecuterAbstractBase + "}"; // Create connection - URL url = new URL("http://alfresco-llm-ai:5000/api/respond"); + URL url = new URL(AI_ENDPOINT_URL); HttpURLConnection conn = (HttpURLConnection) url.openConnection(); conn.setRequestMethod("POST"); conn.setRequestProperty("Content-Type", "application/json"); diff --git a/repository/src/main/resources/alfresco/action-services-context.xml b/repository/src/main/resources/alfresco/action-services-context.xml index 3ce48201f1..a4b11b99aa 100644 --- a/repository/src/main/resources/alfresco/action-services-context.xml +++ b/repository/src/main/resources/alfresco/action-services-context.xml @@ -449,12 +449,13 @@ - + + {http://www.alfresco.org/model/content/1.0}content diff --git a/repository/src/main/resources/alfresco/repository.properties b/repository/src/main/resources/alfresco/repository.properties index 016ac28b36..b328873b8b 100644 --- a/repository/src/main/resources/alfresco/repository.properties +++ b/repository/src/main/resources/alfresco/repository.properties @@ -1045,6 +1045,9 @@ content.transformer.retryOn.different.mimetype=true transformer.debug.entries=0 transformer.log.entries=50 +# AI Endpoint +ai.endpoint.url=http://alfresco-llm-ai:5000/api/respond + # # Lock timeout configuration #