/**
 * This file is part of the NocoBase (R) project.
 * Copyright (c) 2020-2024 NocoBase Co., Ltd.
 * Authors: NocoBase Team.
 *
 * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
 * For more information, please refer to: https://www.nocobase.com/agreement.
 */

"use strict";(self.webpackChunk_nocobase_plugin_ai=self.webpackChunk_nocobase_plugin_ai||[]).push([["91"],{2686:function(e,o,t){t.r(o),t.d(o,{Messages:function(){return y},MessagesSettings:function(){return v}});var r=t(3772),n=t(8156),a=t.n(n),p=t(3990),s=t(7584),l=t(4632),m=t(3505),i=t(8433),c=(0,m.observer)(function(){var e=(0,p.NT)(),o=(0,m.useField)().query(".type").take();return"image_url"===o.value||"image_base64"===o.value?a().createElement(r.SchemaComponent,{components:{WorkflowVariableInput:i.WorkflowVariableInput},schema:{type:"void",properties:{image_url:{type:"object",properties:{url:{title:(0,s.tval)("Image",{ns:p.uD}),type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableInput","x-component-props":{changeOnSelect:!0}}}}}}}):a().createElement(r.SchemaComponent,{components:{WorkflowVariableRawTextArea:i.WorkflowVariableRawTextArea},schema:{type:"void",properties:{content:{title:e("Content"),type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea","x-component-props":{autoSize:{minRows:5}}}}}})}),u=(0,m.observer)(function(){var e=(0,p.NT)();return"user"===(0,m.useField)().query(".role").take().value?a().createElement(r.SchemaComponent,{components:{UserMessage:c},schema:{type:"void",properties:{content:{type:"array","x-component":"ArrayCollapse","x-component-props":{size:"small",bordered:!1},default:[{type:"text"}],"x-decorator":"FormItem",items:{type:"object","x-component":"ArrayCollapse.CollapsePanel","x-component-props":{header:e("Content")},properties:{form:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:{type:{title:e("Type"),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:e("Text"),value:"text"},{label:e("Image (send via URL)"),value:"image_url"},{label:e("Image (send via Base64)"),value:"image_base64"}],default:"text"},user:{type:"void","x-component":"UserMessage"}}},moveUp:{type:"void","x-component":"ArrayCollapse.MoveUp"},moveDown:{type:"void","x-component":"ArrayCollapse.MoveDown"},remove:{type:"void","x-component":"ArrayCollapse.Remove"}}},properties:{addition:{type:"void",title:(0,s.tval)("Add content",{ns:p.uD}),"x-component":"ArrayCollapse.Addition","x-component-props":{defaultValue:{type:"text"}}}}}}}}):a().createElement(r.SchemaComponent,{components:{WorkflowVariableRawTextArea:i.WorkflowVariableRawTextArea},schema:{type:"void",properties:{message:{title:(0,s.tval)("Content",{ns:p.uD}),type:"string","x-decorator":"FormItem","x-component":"WorkflowVariableRawTextArea"}}}})}),y=function(){var e=(0,p.NT)();return a().createElement(r.SchemaComponent,{components:{ArrayCollapse:l.ArrayCollapse,FormLayout:l.FormLayout,Content:u},schema:{type:"void",properties:{messages:{type:"array","x-component":"ArrayCollapse","x-component-props":{size:"small"},"x-decorator":"FormItem",default:[{role:"user",content:[{type:"text"}]}],items:{type:"object","x-component":"ArrayCollapse.CollapsePanel","x-component-props":{header:e("Message")},properties:{form:{type:"void","x-component":"FormLayout","x-component-props":{layout:"vertical"},properties:{role:{title:(0,s.tval)("Role",{ns:p.uD}),type:"string","x-decorator":"FormItem","x-component":"Select",enum:[{label:"System",value:"system"},{label:"User",value:"user"},{label:"Assistant",value:"assistant"}],default:"user"},content:{type:"void","x-component":"Content"}}},moveUp:{type:"void","x-component":"ArrayCollapse.MoveUp"},moveDown:{type:"void","x-component":"ArrayCollapse.MoveDown"},remove:{type:"void","x-component":"ArrayCollapse.Remove"}}},properties:{addition:{type:"void",title:(0,s.tval)("Add prompt",{ns:p.uD}),"x-component":"ArrayCollapse.Addition","x-component-props":{defaultValue:{role:"user",content:[{type:"text"}]}}}}}}}})},v=function(){return a().createElement(r.SchemaComponent,{components:{Messages:y},schema:{type:"void",properties:{messages:{type:"void","x-component":"Messages"}}}})}}}]);