feat(storage): integrate AWS S3 support in storage settings

- Added support for AWS S3 as a storage engine, including configuration options for endpoint, region, access key, secret key, bucket name, and path prefix.
- Updated the StorageEngineConfig interface to include S3 configuration.
- Enhanced the UI components to allow users to configure S3 settings and test connections.
- Updated localization files to include new S3-related labels and descriptions in multiple languages.

These changes significantly enhance the storage capabilities of the application, providing users with more options for managing their data.
main
wizardchen 2026-03-09 11:14:47 +08:00 committed by lyingbug
parent b5edc4aa39
commit 3f340771e9
13 changed files with 303 additions and 19 deletions

View File

@ -173,7 +173,7 @@ export function reconnectDocReader(addr: string): Promise<ParserEnginesResponse
// ---- 存储引擎配置(租户级,供文档/图片存储与 docreader 使用) ----
export interface StorageEngineConfig {
default_provider: string // "local" | "minio" | "cos" | "tos"
default_provider: string // "local" | "minio" | "cos" | "tos" | "s3"
local?: { path_prefix: string }
minio?: { mode: string; endpoint: string; access_key_id: string; secret_access_key: string; bucket_name: string; use_ssl: boolean; path_prefix: string }
cos?: {
@ -192,6 +192,14 @@ export interface StorageEngineConfig {
bucket_name: string
path_prefix: string
}
s3?: {
endpoint: string
region: string
access_key: string
secret_key: string
bucket_name: string
path_prefix: string
}
}
export interface StorageEngineStatusItem {
@ -218,10 +226,11 @@ export function getStorageEngineStatus(): Promise<{ data: GetStorageEngineStatus
}
export interface StorageCheckRequest {
provider: string // "minio" | "cos" | "tos"
provider: string // "minio" | "cos" | "tos" | "s3"
minio?: StorageEngineConfig['minio']
cos?: StorageEngineConfig['cos']
tos?: StorageEngineConfig['tos']
s3?: StorageEngineConfig['s3']
}
export interface StorageCheckResponse {

View File

@ -25,7 +25,7 @@
@click="selectTemplate(template)"
>
<div class="template-item-header">
<span class="template-name">{{ template.name }}</span>
<span class="template-name">{{ getTemplateName(template) }}</span>
<span v-if="template.has_knowledge_base" class="template-tag kb-tag">
<t-icon name="folder" size="12px" />
{{ $t('promptTemplate.withKnowledgeBase') }}
@ -35,7 +35,7 @@
{{ $t('promptTemplate.withWebSearch') }}
</span>
</div>
<p class="template-desc">{{ template.description }}</p>
<p class="template-desc">{{ getTemplateDesc(template) }}</p>
</div>
</div>
</div>
@ -55,8 +55,11 @@
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue';
import { useI18n } from 'vue-i18n';
import { getPromptTemplates, type PromptTemplate, type PromptTemplatesConfig } from '@/api/system';
const { t } = useI18n();
const props = defineProps<{
type: 'systemPrompt' | 'contextTemplate' | 'rewriteSystem' | 'rewriteUser' | 'fallback';
hasKnowledgeBase?: boolean;
@ -71,6 +74,57 @@ const popupVisible = ref(false);
const loading = ref(false);
const templatesConfig = ref<PromptTemplatesConfig | null>(null);
const templateI18nKeyMap: Record<string, Record<string, string>> = {
systemPrompt: {
default_kb: 'defaultKB',
expert_assistant: 'expert',
customer_service: 'customerService',
technical_support: 'techSupport',
pure_chat: 'pureChat',
web_search_assistant: 'webSearch',
},
contextTemplate: {
default_context: 'default',
detailed_context: 'detailed',
simple_context: 'simple',
qa_context: 'qa',
},
rewriteSystem: {
default_rewrite_system: 'default',
strict_rewrite_system: 'strict',
},
rewriteUser: {
default_rewrite_user: 'default',
detailed_rewrite_user: 'detailed',
},
fallback: {
default_fallback: 'default',
polite_fallback: 'polite',
brief_fallback: 'brief',
model_fallback: 'model',
},
};
function getTemplateName(template: PromptTemplate): string {
const key = templateI18nKeyMap[props.type]?.[template.id];
if (key) {
const i18nKey = `promptTemplate.${props.type}.${key}.name`;
const translated = t(i18nKey);
if (translated !== i18nKey) return translated;
}
return template.name;
}
function getTemplateDesc(template: PromptTemplate): string {
const key = templateI18nKeyMap[props.type]?.[template.id];
if (key) {
const i18nKey = `promptTemplate.${props.type}.${key}.desc`;
const translated = t(i18nKey);
if (translated !== i18nKey) return translated;
}
return template.description;
}
const handleVisibleChange = async (visible: boolean) => {
popupVisible.value = visible;
// 首次打开时加载模板

View File

@ -616,6 +616,7 @@ export default {
engineLocal: 'Local',
engineCos: 'Tencent Cloud COS',
engineTos: 'Volcengine TOS',
engineS3: 'AWS S3',
localTitle: 'Local Storage',
localDesc: 'Store files on the server local filesystem, suitable for single-node deployment only.',
available: 'Available',
@ -644,6 +645,10 @@ export default {
tosDesc: 'Volcengine Object Storage Service (TOS), suitable for public cloud deployment.',
tosAccessKeyPlaceholder: 'Volcengine Access Key',
tosSecretKeyPlaceholder: 'Volcengine Secret Key',
s3Title: 'AWS S3',
s3Desc: 'AWS S3 and S3-compatible object storage services, suitable for public cloud deployment.',
s3AccessKeyPlaceholder: 'AWS Access Key',
s3SecretKeyPlaceholder: 'AWS Secret Key',
console: 'Console',
docs: 'Docs',
testConnection: 'Test Connection',
@ -3024,6 +3029,8 @@ export default {
engineCosDesc: 'Public cloud deployment, supports CDN acceleration',
engineTos: 'Volcengine TOS',
engineTosDesc: 'Volcengine object storage, for public cloud deployment',
engineS3: 'AWS S3',
engineS3Desc: 'AWS S3 and compatible storage, for public cloud deployment',
},
parser: {
title: 'Parser Engine',
@ -3042,6 +3049,20 @@ export default {
fileTypeCsv: 'CSV Files',
fileTypeText: 'Plain Text',
fileTypeImage: 'Images',
engines: {
simple: {
name: 'Simple',
desc: 'Simple format & image parsing (no external service required)',
},
mineru: {
name: 'MinerU',
desc: 'MinerU self-hosted service',
},
mineru_cloud: {
name: 'MinerU Cloud',
desc: 'MinerU Cloud API',
},
},
},
supportedFormats: 'Supported formats',
},

View File

@ -469,6 +469,7 @@ export default {
engineLocal: 'Local(로컬)',
engineCos: 'Tencent Cloud COS',
engineTos: 'Volcengine TOS',
engineS3: 'AWS S3',
localTitle: 'Local(로컬 스토리지)',
localDesc: '서버 로컬 파일시스템에 파일을 저장합니다. 단일 노드 배포에만 적합합니다.',
available: '사용 가능',
@ -497,6 +498,10 @@ export default {
tosDesc: 'Volcengine 오브젝트 스토리지(TOS), 퍼블릭 클라우드 배포에 적합합니다.',
tosAccessKeyPlaceholder: 'Volcengine Access Key',
tosSecretKeyPlaceholder: 'Volcengine Secret Key',
s3Title: 'AWS S3',
s3Desc: 'AWS S3 및 호환 오브젝트 스토리지 서비스, 퍼블릭 클라우드 배포에 적합합니다.',
s3AccessKeyPlaceholder: 'AWS Access Key',
s3SecretKeyPlaceholder: 'AWS Secret Key',
console: '콘솔',
docs: '문서',
testConnection: '연결 테스트',
@ -3092,6 +3097,8 @@ export default {
engineCosDesc: '퍼블릭 클라우드 배포, CDN 가속 지원',
engineTos: 'Volcengine TOS',
engineTosDesc: 'Volcengine 오브젝트 스토리지, 퍼블릭 클라우드 배포에 적합',
engineS3: 'AWS S3',
engineS3Desc: 'AWS S3 및 호환 스토리지, 퍼블릭 클라우드 배포에 적합',
},
parser: {
title: '파서 엔진',
@ -3110,6 +3117,20 @@ export default {
fileTypeCsv: 'CSV 파일',
fileTypeText: '일반 텍스트',
fileTypeImage: '이미지',
engines: {
simple: {
name: 'Simple',
desc: '간단한 형식 및 이미지 파싱 (외부 서비스 불필요)',
},
mineru: {
name: 'MinerU',
desc: 'MinerU 자체 호스팅 서비스',
},
mineru_cloud: {
name: 'MinerU Cloud',
desc: 'MinerU Cloud API',
},
},
},
supportedFormats: '지원 형식',
},

View File

@ -601,6 +601,7 @@ export default {
engineLocal: 'Локальное',
engineCos: 'Tencent Cloud COS',
engineTos: 'Volcengine TOS',
engineS3: 'AWS S3',
localTitle: 'Локальное хранилище',
localDesc: 'Хранение файлов в локальной файловой системе сервера. Подходит только для однонодового развёртывания.',
available: 'Доступно',
@ -629,6 +630,10 @@ export default {
tosDesc: 'Объектное хранилище Volcengine (TOS) для публичного облака.',
tosAccessKeyPlaceholder: 'Volcengine Access Key',
tosSecretKeyPlaceholder: 'Volcengine Secret Key',
s3Title: 'AWS S3',
s3Desc: 'AWS S3 и совместимые сервисы объектного хранилища для публичного облака.',
s3AccessKeyPlaceholder: 'AWS Access Key',
s3SecretKeyPlaceholder: 'AWS Secret Key',
console: 'Консоль',
docs: 'Документация',
testConnection: 'Тест подключения',
@ -2622,7 +2627,9 @@ export default {
engineCos: 'Tencent Cloud COS',
engineCosDesc: 'Публичное облако, поддержка CDN-ускорения',
engineTos: 'Volcengine TOS',
engineTosDesc: 'Объектное хранилище Volcengine, для публичного облака'
engineTosDesc: 'Объектное хранилище Volcengine, для публичного облака',
engineS3: 'AWS S3',
engineS3Desc: 'AWS S3 и совместимые хранилища, для публичного облака',
},
parser: {
title: 'Парсер',
@ -2640,7 +2647,21 @@ export default {
fileTypeExcel: 'Таблицы Excel',
fileTypeCsv: 'Файлы CSV',
fileTypeText: 'Текстовые файлы',
fileTypeImage: 'Изображения'
fileTypeImage: 'Изображения',
engines: {
simple: {
name: 'Simple',
desc: 'Простой формат и анализ изображений (внешний сервис не требуется)',
},
mineru: {
name: 'MinerU',
desc: 'Самостоятельно развёрнутый сервис MinerU',
},
mineru_cloud: {
name: 'MinerU Cloud',
desc: 'MinerU Cloud API',
},
},
},
supportedFormats: 'Поддерживаемые форматы'
},

View File

@ -466,6 +466,7 @@ export default {
engineLocal: "Local(本地)",
engineCos: "腾讯云 COS",
engineTos: "火山引擎 TOS",
engineS3: "AWS S3",
localTitle: "Local(本地存储)",
localDesc: "使用服务器本地文件系统存储文件,仅适合单机部署。",
available: "可用",
@ -494,6 +495,10 @@ export default {
tosDesc: "火山引擎对象存储服务(TOS),适合公有云部署。",
tosAccessKeyPlaceholder: "火山引擎 Access Key",
tosSecretKeyPlaceholder: "火山引擎 Secret Key",
s3Title: "AWS S3",
s3Desc: "AWS S3 及兼容的对象存储服务,适合公有云部署。",
s3AccessKeyPlaceholder: "AWS Access Key",
s3SecretKeyPlaceholder: "AWS Secret Key",
console: "控制台",
docs: "文档",
testConnection: "测试连接",
@ -3021,6 +3026,8 @@ export default {
engineCosDesc: "公有云部署,支持 CDN 加速",
engineTos: "火山引擎 TOS",
engineTosDesc: "火山引擎对象存储,适合公有云部署",
engineS3: "AWS S3",
engineS3Desc: "AWS S3 及兼容存储,适合公有云部署",
},
parser: {
title: "解析引擎",
@ -3039,6 +3046,20 @@ export default {
fileTypeCsv: "CSV 文件",
fileTypeText: "纯文本",
fileTypeImage: "图片",
engines: {
simple: {
name: "Simple",
desc: "简单格式 & 图片解析(无需外部服务)",
},
mineru: {
name: "MinerU",
desc: "MinerU 自部署服务",
},
mineru_cloud: {
name: "MinerU Cloud",
desc: "MinerU Cloud API",
},
},
},
supportedFormats: "支持格式",
},

View File

@ -33,7 +33,7 @@
<div class="action-header" @click="toggleEvent(event.event_id)">
<div class="action-title">
<img class="action-title-icon" :src="thinkingIcon" alt="" />
<span class="action-name">深度思考</span>
<span class="action-name">{{ $t('agent.think') }}</span>
<span v-if="getThinkingSummary(event) && !isEventExpanded(event.event_id)" class="action-summary">{{ getThinkingSummary(event) }}</span>
</div>
<div v-if="event.content" class="action-show-icon">
@ -54,7 +54,7 @@
<div class="action-header" @click="toggleEvent(event.tool_call_id)">
<div class="action-title">
<img class="action-title-icon" :src="thinkingIcon" alt="" />
<span class="action-name">深度思考</span>
<span class="action-name">{{ $t('agent.think') }}</span>
<span v-if="event.tool_data?.thought_number" class="action-badge">{{ event.tool_data.thought_number }}/{{ event.tool_data.total_thoughts }}</span>
<span v-if="getThinkingSummary(event) && !isEventExpanded(event.tool_call_id)" class="action-summary">{{ getThinkingSummary(event) }}</span>
</div>
@ -168,7 +168,7 @@
<div class="action-header" @click="toggleEvent(event.event_id)">
<div class="action-title">
<img class="action-title-icon" :src="thinkingIcon" alt="" />
<span class="action-name">深度思考</span>
<span class="action-name">{{ $t('agent.think') }}</span>
<span v-if="getThinkingSummary(event) && !isEventExpanded(event.event_id)" class="action-summary">{{ getThinkingSummary(event) }}</span>
</div>
<div v-if="event.content" class="action-show-icon">
@ -189,7 +189,7 @@
<div class="action-header" @click="toggleEvent(event.tool_call_id)">
<div class="action-title">
<img class="action-title-icon" :src="thinkingIcon" alt="" />
<span class="action-name">深度思考</span>
<span class="action-name">{{ $t('agent.think') }}</span>
<span v-if="event.tool_data?.thought_number" class="action-badge">{{ event.tool_data.thought_number }}/{{ event.tool_data.total_thoughts }}</span>
<span v-if="getThinkingSummary(event) && !isEventExpanded(event.tool_call_id)" class="action-summary">{{ getThinkingSummary(event) }}</span>
</div>

View File

@ -7,7 +7,7 @@
class="result-row"
>
<div class="result-row__index">#{{ index + 1 }}</div>
<div class="result-row__title">{{ result.knowledge_title || 'Untitled' }}</div>
<div class="result-row__title">{{ result.knowledge_title || $t('knowledge.untitledDocument') }}</div>
</div>
</div>

View File

@ -51,7 +51,7 @@
>
<div class="engine-option">
<div class="engine-option-top">
<span class="engine-option-name">{{ opt.value }}</span>
<span class="engine-option-name">{{ getEngineDisplayName(opt.value) }}</span>
<t-tag
v-if="opt.isDefault"
theme="primary"
@ -65,7 +65,7 @@
size="small"
>{{ $t('kbSettings.parser.unavailable') }}</t-tag>
</div>
<div class="engine-option-desc">{{ opt.desc }}</div>
<div class="engine-option-desc">{{ getEngineDisplayDesc(opt.value, opt.desc) }}</div>
<div v-if="opt.disabled && opt.reason" class="engine-option-reason">
{{ opt.reason }}
<a class="go-settings" @click.stop.prevent="goToParserSettings">{{ $t('kbSettings.parser.goSettings') }}</a>
@ -92,6 +92,18 @@ import { storeToRefs } from 'pinia'
const { t } = useI18n()
function getEngineDisplayName(engineName: string): string {
const key = `kbSettings.parser.engines.${engineName}.name`
const translated = t(key)
return translated !== key ? translated : engineName
}
function getEngineDisplayDesc(engineName: string, fallback: string): string {
const key = `kbSettings.parser.engines.${engineName}.desc`
const translated = t(key)
return translated !== key ? translated : fallback
}
export interface ParserEngineRule {
file_types: string[]
engine: string
@ -176,7 +188,7 @@ function getEngineOptions(extensions: string[]): EngineOption[] {
const defaultName = raw.find(e => e.available)?.name ?? ''
return raw.map(e => ({
value: e.name,
selectLabel: `${e.name} — ${e.desc}`,
selectLabel: `${getEngineDisplayName(e.name)} — ${getEngineDisplayDesc(e.name, e.desc)}`,
desc: e.desc,
fileTypes: e.fileTypes,
disabled: !e.available,

View File

@ -108,6 +108,13 @@ const engineOptions = computed(() => {
available: statusMap.tos,
disabled: statusMap.tos === false,
},
{
value: 's3',
label: t('kbSettings.storage.engineS3'),
desc: t('kbSettings.storage.engineS3Desc'),
available: statusMap.s3,
disabled: statusMap.s3 === false,
},
]
})
@ -139,7 +146,7 @@ async function load() {
engineStatus.value = engines
defaultProvider.value = configRes?.data?.default_provider || 'local'
const d = configRes?.data
hasAnyConfig.value = !!(d?.local?.path_prefix || d?.minio?.bucket_name || d?.cos?.bucket_name || d?.tos?.bucket_name)
hasAnyConfig.value = !!(d?.local?.path_prefix || d?.minio?.bucket_name || d?.cos?.bucket_name || d?.tos?.bucket_name || d?.s3?.bucket_name)
if (!localProvider.value || localProvider.value === '') {
localProvider.value = defaultProvider.value
emit('update:storageProvider', localProvider.value)

View File

@ -200,6 +200,7 @@ const navItems = computed(() => [
{ key: 'minio', label: 'MinIO' },
{ key: 'cos', label: t('settings.storage.cos') },
{ key: 'tos', label: t('settings.storage.tos') },
{ key: 's3', label: 'AWS S3' },
]
},
{ key: 'mcp', icon: 'tools', label: t('settings.mcpService') },

View File

@ -33,6 +33,7 @@
<t-option value="minio" label="MinIO" />
<t-option value="cos" :label="$t('settings.storage.engineCos')" />
<t-option value="tos" :label="$t('settings.storage.engineTos')" />
<t-option value="s3" label="AWS S3" />
</t-select>
</div>
</div>
@ -347,6 +348,80 @@
</div>
</div>
<!-- S3 -->
<div class="engine-section" data-model-type="s3">
<div class="engine-header">
<div class="engine-header-info">
<div class="engine-title-row">
<h3>{{ $t('settings.storage.s3Title') }}</h3>
<t-tag theme="success" variant="light" size="small">{{ $t('settings.storage.configurable') }}</t-tag>
</div>
<p>
{{ $t('settings.storage.s3Desc') }}
<a class="engine-link" href="https://aws.amazon.com/s3/" target="_blank" rel="noopener">{{ $t('settings.storage.console') }} ↗</a>
<a class="engine-link" href="https://docs.aws.amazon.com/s3/" target="_blank" rel="noopener">{{ $t('settings.storage.docs') }} ↗</a>
</p>
</div>
</div>
<div class="engine-form">
<div class="form-field">
<label>Endpoint</label>
<t-input
v-model="config.s3.endpoint"
placeholder="e.g. https://s3.amazonaws.com"
clearable
/>
</div>
<div class="form-field">
<label>Region</label>
<t-input
v-model="config.s3.region"
placeholder="e.g. us-east-1"
clearable
/>
</div>
<div class="form-field">
<label>Access Key</label>
<t-input
v-model="config.s3.access_key"
:placeholder="$t('settings.storage.s3AccessKeyPlaceholder')"
clearable
/>
</div>
<div class="form-field">
<label>Secret Key</label>
<t-input
v-model="config.s3.secret_key"
type="password"
:placeholder="$t('settings.storage.s3SecretKeyPlaceholder')"
clearable
/>
</div>
<div class="form-field">
<label>{{ $t('settings.storage.bucketName') }}</label>
<t-input
v-model="config.s3.bucket_name"
:placeholder="$t('settings.storage.bucketPlaceholder')"
clearable
/>
</div>
<div class="form-field">
<label>{{ $t('settings.storage.pathPrefix') }}</label>
<t-input
v-model="config.s3.path_prefix"
:placeholder="$t('settings.storage.prefixPlaceholder')"
clearable
/>
</div>
</div>
<div class="test-bar">
<t-button size="small" variant="outline" :loading="checkingS3" @click="onCheckS3">{{ $t('settings.storage.testConnection') }}</t-button>
<span v-if="s3CheckResult" :class="['test-msg', s3CheckResult.ok ? 'success' : 'error']">
{{ s3CheckResult.message }}
</span>
</div>
</div>
<!-- Save -->
<div class="save-bar">
<t-button theme="primary" :loading="saving" @click="onSave">{{ $t('settings.storage.saveConfig') }}</t-button>
@ -393,6 +468,14 @@ const defaultConfig = (): StorageEngineConfig => ({
bucket_name: '',
path_prefix: '',
},
s3: {
endpoint: '',
region: '',
access_key: '',
secret_key: '',
bucket_name: '',
path_prefix: '',
},
})
const loading = ref(true)
@ -416,6 +499,8 @@ const checkingCos = ref(false)
const cosCheckResult = ref<{ ok: boolean; message: string } | null>(null)
const checkingTos = ref(false)
const tosCheckResult = ref<{ ok: boolean; message: string } | null>(null)
const checkingS3 = ref(false)
const s3CheckResult = ref<{ ok: boolean; message: string } | null>(null)
const minioAvailable = computed(() => {
if (config.value.minio?.mode === 'remote') {
@ -463,6 +548,16 @@ async function loadConfig() {
path_prefix: d.tos.path_prefix || '',
}
: defaultConfig().tos!,
s3: d.s3
? {
endpoint: d.s3.endpoint || '',
region: d.s3.region || '',
access_key: d.s3.access_key || '',
secret_key: d.s3.secret_key || '',
bucket_name: d.s3.bucket_name || '',
path_prefix: d.s3.path_prefix || '',
}
: defaultConfig().s3!,
}
}
} catch {
@ -546,6 +641,14 @@ function buildPayload(): StorageEngineConfig {
bucket_name: (config.value.tos?.bucket_name || '').trim(),
path_prefix: (config.value.tos?.path_prefix || '').trim(),
},
s3: {
endpoint: (config.value.s3?.endpoint || '').trim(),
region: (config.value.s3?.region || '').trim(),
access_key: (config.value.s3?.access_key || '').trim(),
secret_key: (config.value.s3?.secret_key || '').trim(),
bucket_name: (config.value.s3?.bucket_name || '').trim(),
path_prefix: (config.value.s3?.path_prefix || '').trim(),
},
}
}
@ -611,6 +714,20 @@ async function onCheckTos() {
}
}
async function onCheckS3() {
checkingS3.value = true
s3CheckResult.value = null
try {
const payload = buildPayload()
const res = await checkStorageEngine({ provider: 's3', s3: payload.s3 })
s3CheckResult.value = res?.data ?? { ok: false, message: t('settings.storage.unknownError') }
} catch (e: unknown) {
s3CheckResult.value = { ok: false, message: e instanceof Error ? e.message : t('settings.storage.requestFailed') }
} finally {
checkingS3.value = false
}
}
onMounted(loadAll)
</script>

View File

@ -43,7 +43,7 @@ type simpleEngine struct{}
func (e *simpleEngine) Name() string { return SimpleEngineName }
func (e *simpleEngine) Description() string {
return "简单格式 & 图片解析(无需外部服务)"
return "Simple format & image parsing (no external service required)"
}
func (e *simpleEngine) FileTypes(_ bool) []string {
return []string{"md", "markdown", "txt", "csv", "jpg", "jpeg", "png", "gif", "bmp", "tiff", "webp"}
@ -59,14 +59,14 @@ func (e *simpleEngine) CheckAvailable(_ bool, _ map[string]string) (bool, string
type mineruEngine struct{}
func (e *mineruEngine) Name() string { return "mineru" }
func (e *mineruEngine) Description() string { return "MinerU 自部署服务" }
func (e *mineruEngine) Description() string { return "MinerU self-hosted service" }
func (e *mineruEngine) FileTypes(_ bool) []string {
return []string{"pdf", "jpg", "jpeg", "png", "bmp", "tiff", "doc", "docx", "ppt", "pptx"}
}
func (e *mineruEngine) CheckAvailable(_ bool, overrides map[string]string) (bool, string) {
endpoint := strings.TrimSpace(overrides["mineru_endpoint"])
if endpoint == "" {
return false, "未配置 MinerU 服务"
return false, "MinerU service not configured"
}
return PingMinerU(endpoint)
}
@ -85,7 +85,7 @@ func (e *mineruCloudEngine) FileTypes(_ bool) []string {
func (e *mineruCloudEngine) CheckAvailable(_ bool, overrides map[string]string) (bool, string) {
apiKey := strings.TrimSpace(overrides["mineru_api_key"])
if apiKey == "" {
return false, "未配置 MinerU API Key"
return false, "MinerU API Key not configured"
}
return PingMinerUCloud(apiKey)
}