df9e7244 by Ean Schuessler

Continuing to flesh out MCP connectivity

1 parent 7abaf27f
...@@ -30,6 +30,21 @@ ...@@ -30,6 +30,21 @@
30 <set field="locale" from="ec.user?.locale ?: 'en_US'"/> 30 <set field="locale" from="ec.user?.locale ?: 'en_US'"/>
31 </actions> 31 </actions>
32 32
33 <transition name="fixConfig">
34 <actions>
35 <script><![CDATA[
36 ec.entity.find("moqui.mcp.agent.ProductStoreAiConfig")
37 .condition("productStoreId", "POPC_DEFAULT")
38 .condition("aiConfigId", "DEFAULT")
39 .one()
40 .set("modelName", "devstral")
41 .update()
42 ]]></script>
43 <set field="message" value="Config updated successfully to devstral"/>
44 </actions>
45 <default-response type="screen-last"/>
46 </transition>
47
33 <widgets> 48 <widgets>
34 <container style="mcp-test-screen"> 49 <container style="mcp-test-screen">
35 <container style="text-center"> 50 <container style="text-center">
......
1 <?xml version="1.0" encoding="UTF-8"?>
2 <services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xsi:noNamespaceSchemaLocation="http://moqui.org/xsd/service-definition-3.xsd">
4
5 <service verb="update" noun="ModelName" authenticate="false">
6 <description>Update modelName in ProductStoreAiConfig</description>
7 <actions>
8 <script><![CDATA[
9 def config = ec.entity.find("moqui.mcp.agent.ProductStoreAiConfig")
10 .condition("productStoreId", "POPC_DEFAULT")
11 .condition("aiConfigId", "DEFAULT")
12 .one()
13
14 if (config) {
15 ec.logger.info("UPDATE MODEL NAME: Current=${config.modelName}")
16 config.modelName = "devstral"
17 config.update()
18 ec.logger.info("UPDATE MODEL NAME: Updated to=${config.modelName}")
19 return "Updated modelName to devstral"
20 } else {
21 ec.logger.warn("UPDATE MODEL NAME: Config not found")
22 return "Config not found"
23 }
24 ]]></script>
25 </actions>
26 </service>
27 </services>