Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions content/ai/aiChatInput/index-en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -1515,6 +1515,23 @@ render(<CustomRichTextExtension />);
| uploadProps | Upload configuration | UploadProps | - |
| uploadTipProps | Upload tip configuration | UploadTipProps | - |

### Configure.Select
Same as [SelectProps](/en-US/input/select)

### Configure.Button
Same as [ButtonProps](/en-US/basic/button#Button)

### Configure.RadioButton
Same as [RadioGroupProps](/zh-CN/input/radio#RadioGroup)

### Configure.Mcp
| Method | Description | Type | Default |
|-----|----|------|-------|
| options | Mcp options | McpOption | - |
| showConfigure | Displaying the configuration button (added in v2.89.0) | boolean | true |
| onConfigureButtonClick | Callback when the configuration button is clicked | () => void | - |


## Methods

| Method | Description | Type | Default |
Expand Down
18 changes: 17 additions & 1 deletion content/ai/aiChatInput/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ function ConfigureButton() {
const renderLeftMenu = useCallback(() => (<>
<Configure.Select optionList={modelOptions} field="model" initValue="GPT-4o" />
<Configure.Button icon={<IconBookOpenStroked />} field="onlineSearch">联网搜索</Configure.Button>
<Configure.Mcp options={mcpOptions} onConfigureButtonClick={onConfigureButtonClick}/>
<Configure.Mcp options={mcpOptions} onConfigureButtonClick={onConfigureButtonClick} showConfigure={true}/>
<Configure.RadioButton options={radioButtonProps} field="thinkType" initValue="fast"/>
</>), []);

Expand Down Expand Up @@ -1593,6 +1593,22 @@ render(<CustomRichTextExtension />);
| uploadProps | 上传文件相关配置 | UploadProps | - |
| uploadTipProps | 上传文件相关提示配置 | UploadTipProps | - |

### Configure.Select
同 [ButtonProps](/zh-CN/input/select)

### Configure.Button
同 [ButtonProps](/zh-CN/basic/button#Button)

### Configure.RadioButton
同 [RadioGroupProps](/zh-CN/input/radio#RadioGroup)

### Configure.Mcp
| 属性 | 说明 | 类型 | 默认值 |
|-----|----|------|-------|
| options | mcp 选项 | McpOption | - |
| showConfigure | 是否显示配置按钮, v2.89.0 新增 | boolean | true |
| onConfigureButtonClick | 点击配置按钮的回调 | () => void | - |

## Methods

| 属性 | 说明 | 类型 | 默认值 |
Expand Down
7 changes: 4 additions & 3 deletions packages/semi-ui/aiChatInput/configure/mcp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ export interface McpOption {
export interface McpProps extends DropdownProps {
options: McpOption[];
num?: number;
showConfigure: boolean;
onConfigureButtonClick: () => void
}

// because there may be grouping or nested dropdown forms.
const Mcp = React.memo((props: McpProps) => {
const { className, style, options = [], num = 0, children, onConfigureButtonClick, ...rest } = props;
const { className, style, options = [], num = 0, children, onConfigureButtonClick, showConfigure = true, ...rest } = props;

const onClick = useCallback((e: MouseEvent) => {
// Prevent accidental closing of dropdown when clicking Button
Expand All @@ -41,13 +42,13 @@ const Mcp = React.memo((props: McpProps) => {
<span className={`${cssClasses.PREFIX}-footer-configure-mcp-header-title`} >
{locale.selected.replace('${count}', String(options.length ?? num))}
</span>
<Button
{showConfigure && <Button
theme='outline'
className={`${cssClasses.PREFIX}-footer-configure-mcp-header-config`}
onClick={onConfigureButtonClick}
>
{locale.configure}
</Button>
</Button>}
</div>
{children ? children : <>
<Dropdown.Menu>
Expand Down
Loading