mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
made ai endpoint url configurable and renamed bean to ai action
This commit is contained in:
@@ -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<ParameterDefinition> 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");
|
||||
|
@@ -449,12 +449,13 @@
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="ai-summary" class="org.alfresco.repo.action.executer.AISummaryActionExecuter" parent="action-executer">
|
||||
<bean id="ai-action" class="org.alfresco.repo.action.executer.AISummaryActionExecuter" parent="action-executer">
|
||||
<property name="dictionaryService" ref="dictionaryService" />
|
||||
<property name="contentService" ref="ContentService" />
|
||||
<property name="nodeService" ref="NodeService" />
|
||||
<property name="synchronousTransformClient" ref="synchronousTransformClient" />
|
||||
<property name="converter" ref="transformOptionsConverter" />
|
||||
<property name="AI_ENDPOINT_URL" value="${ai.endpoint.url}" />
|
||||
<property name="applicableTypes">
|
||||
<list>
|
||||
<value>{http://www.alfresco.org/model/content/1.0}content</value>
|
||||
|
@@ -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
|
||||
#
|
||||
|
Reference in New Issue
Block a user