df9e7244 by Ean Schuessler

Continuing to flesh out MCP connectivity

1 parent 7abaf27f
......@@ -30,6 +30,21 @@
<set field="locale" from="ec.user?.locale ?: 'en_US'"/>
</actions>
<transition name="fixConfig">
<actions>
<script><![CDATA[
ec.entity.find("moqui.mcp.agent.ProductStoreAiConfig")
.condition("productStoreId", "POPC_DEFAULT")
.condition("aiConfigId", "DEFAULT")
.one()
.set("modelName", "devstral")
.update()
]]></script>
<set field="message" value="Config updated successfully to devstral"/>
</actions>
<default-response type="screen-last"/>
</transition>
<widgets>
<container style="mcp-test-screen">
<container style="text-center">
......
<?xml version="1.0" encoding="UTF-8"?>
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/service-definition-3.xsd">
<service verb="update" noun="ModelName" authenticate="false">
<description>Update modelName in ProductStoreAiConfig</description>
<actions>
<script><![CDATA[
def config = ec.entity.find("moqui.mcp.agent.ProductStoreAiConfig")
.condition("productStoreId", "POPC_DEFAULT")
.condition("aiConfigId", "DEFAULT")
.one()
if (config) {
ec.logger.info("UPDATE MODEL NAME: Current=${config.modelName}")
config.modelName = "devstral"
config.update()
ec.logger.info("UPDATE MODEL NAME: Updated to=${config.modelName}")
return "Updated modelName to devstral"
} else {
ec.logger.warn("UPDATE MODEL NAME: Config not found")
return "Config not found"
}
]]></script>
</actions>
</service>
</services>