Continuing to flesh out MCP connectivity
Showing
3 changed files
with
42 additions
and
0 deletions
| ... | @@ -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"> | ... | ... |
This diff is collapsed.
Click to expand it.
service/UpdateAgentConfig.xml
0 → 100644
| 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> |
-
Please register or sign in to post a comment