feat(web): app api add body parameter example
This commit is contained in:
@@ -1496,6 +1496,32 @@ export const en = {
|
||||
resetFeaturesTip: 'Please reconfigure the [Conversation Features - File Upload] settings',
|
||||
logTitle: 'Description',
|
||||
range: 'Range',
|
||||
body: 'BODY Parameter Example',
|
||||
bodyRequestExample: `{
|
||||
"message": "user message content",
|
||||
// string, required, the conversation content entered by the user;
|
||||
|
||||
"conversation_id": "conversation_id",
|
||||
// string, optional, session ID; for multi-turn conversations, pass the conversation_id from the previous response; omit on first request;
|
||||
|
||||
"user_id": "user_id",
|
||||
// string, optional, end-user identifier to distinguish memory and sessions across users; recommended to pass your business system user ID;
|
||||
|
||||
"variables": {},
|
||||
// object, optional (requires application configuration to take effect);
|
||||
|
||||
"stream": false,
|
||||
// boolean, optional, whether to stream the response; defaults to false; when true, returns an SSE event stream;
|
||||
|
||||
"thinking": false,
|
||||
// boolean, optional, whether to enable deep thinking; defaults to false (requires application configuration when true);
|
||||
|
||||
"files": [],
|
||||
// array, optional, list of multimodal attachments (requires application configuration to take effect);
|
||||
|
||||
"version":"app_release_id"
|
||||
// string, optional, application version ID; specify a historical release version ID, or omit to use the currently active version;
|
||||
}`,
|
||||
},
|
||||
userMemory: {
|
||||
userMemory: 'User Memory',
|
||||
@@ -2525,6 +2551,7 @@ Memory Bear: After the rebellion, regional warlordism intensified for several re
|
||||
'document-extractor.file_selector': 'File variable',
|
||||
'list-operator.input_list': 'Input list',
|
||||
},
|
||||
checkListHasErrors: 'Please resolve all issues in the checklist before publishing',
|
||||
},
|
||||
emotionEngine: {
|
||||
emotionEngineConfig: 'Emotion Engine Configuration',
|
||||
|
||||
@@ -831,6 +831,32 @@ export const zh = {
|
||||
resetFeaturesTip: '请重新配置【对话功能-文件上传】功能',
|
||||
logTitle: '描述',
|
||||
range: '范围',
|
||||
body: 'BODY 参数示例',
|
||||
bodyRequestExample: `{
|
||||
"message": "用户消息内容",
|
||||
// string,必填,用户输入的对话内容;
|
||||
|
||||
"conversation_id": "conversation_id",
|
||||
// string,可选,会话ID,多轮对话时传上一次返回的conversation_id,首次不传;
|
||||
|
||||
"user_id": "user_id",
|
||||
// string,可选,终端用户标识,用于区分不同用户的记忆和会话,建议传业务系统的用户ID;
|
||||
|
||||
"variables": {},
|
||||
// object,可选(需要应用配置才支持生效);
|
||||
|
||||
"stream": false,
|
||||
// boolean,可选,是否流式返回;默认 false,true时返回SSE事件流;
|
||||
|
||||
"thinking": false,
|
||||
// boolean,可选,是否启用深度思考;默认 false(true时需要应用配置才支持生效);
|
||||
|
||||
"files": [],
|
||||
// array,可选,多模态附件列表(需要应用配置才支持生效);
|
||||
|
||||
"version":"app_release_id"
|
||||
//string,可选,应用版本ID;指定历史发布版本ID,不传则使用当前生效版本;
|
||||
}`,
|
||||
},
|
||||
table: {
|
||||
totalRecords: '共 {{total}} 条记录'
|
||||
@@ -2489,6 +2515,7 @@ export const zh = {
|
||||
'document-extractor.file_selector': '文件变量',
|
||||
'list-operator.input_list': '输入变量',
|
||||
},
|
||||
checkListHasErrors: '发布前确认检查清单中所有问题均已解决',
|
||||
},
|
||||
emotionEngine: {
|
||||
emotionEngineConfig: '情感引擎配置',
|
||||
|
||||
@@ -420,4 +420,7 @@ body {
|
||||
.ant-picker-outlined:focus,
|
||||
.ant-picker-outlined:focus-within {
|
||||
box-shadow: none;
|
||||
}
|
||||
.ͼ1.cm-focused {
|
||||
outline: none;
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
* @Author: ZhaoYing
|
||||
* @Date: 2026-02-03 16:29:29
|
||||
* @Last Modified by: ZhaoYing
|
||||
* @Last Modified time: 2026-03-26 15:31:36
|
||||
* @Last Modified time: 2026-04-10 18:09:56
|
||||
*/
|
||||
import { type FC, useState, useRef, useEffect } from 'react';
|
||||
import clsx from 'clsx';
|
||||
@@ -18,6 +18,7 @@ import ApiKeyConfigModal from './components/ApiKeyConfigModal';
|
||||
import { getApiKeyList, getApiKeyStats, deleteApiKey } from '@/api/apiKey';
|
||||
import { maskApiKeys } from '@/utils/apiKeyReplacer'
|
||||
import RbCard from '@/components/RbCard/Card';
|
||||
import CodeMirrorEditor from '@/components/CodeMirrorEditor'
|
||||
|
||||
/**
|
||||
* API configuration page component
|
||||
@@ -155,6 +156,21 @@ const Api: FC<{ application: Application | null }> = ({ application }) => {
|
||||
{t('common.copy')}
|
||||
</Button>
|
||||
</Flex>
|
||||
|
||||
<div className="rb:font-medium rb:mt-4!">
|
||||
{t('application.body')}
|
||||
</div>
|
||||
<Flex align="start" justify="space-between" className="rb:text-[#5B6167] rb:mt-3! rb:py-2! rb:px-4! rb:bg-white rb-border rb:rounded-lg rb:leading-5">
|
||||
<CodeMirrorEditor readOnly={true} value={t('application.bodyRequestExample')} />
|
||||
|
||||
<Button className="rb:px-2! rb:h-7! rb:group" onClick={() => handleCopy(t('application.bodyRequestExample'))}>
|
||||
<div
|
||||
className="rb:w-4 rb:h-4 rb:cursor-pointer rb:bg-cover rb:bg-[url('@/assets/images/copy.svg')] rb:group-hover:bg-[url('@/assets/images/copy_active.svg')]"
|
||||
></div>
|
||||
{t('common.copy')}
|
||||
</Button>
|
||||
</Flex>
|
||||
|
||||
</RbCard>
|
||||
<RbCard
|
||||
title={() => (<Flex align="center">
|
||||
|
||||
Reference in New Issue
Block a user