mirror of
https://github.com/qingchencloud/clawpanel.git
synced 2026-08-03 04:07:48 +08:00
i18n: - Add 9 new locale files (ja/ko/de/es/fr/pt/ru/vi/zh-TW) - Add multilingual README files for all 11 languages - Add locale helper, index, and modular translation system - Add translation generation scripts Website (docs/index.html): - Replace 公益AI接口 branding with 晴辰云AI接口 - Remove OpenClaw 独立安装包 promotion block - Update SEO meta tags (description, keywords, OG, Twitter, JSON-LD) - Add 11-language README links to footer - Update 元宝派 link to new URL Bug fixes: - fix(cron): delivery format mode:'push' → mode:'announce', remove invalid 'to' field (fixes #141) - fix(cron): allow single-channel users to select delivery channel - fix(cron): preserve delivery field in job state for editing - fix(models): add 'ollama' as recognized API type, prevent overwriting native ollama config (fixes #140) - fix(models): skip /v1 append for ollama native API baseUrl - fix(assistant): normalize 'google-generative-ai' consistently, add ollama hints - fix(version): use CLI path classification for source detection on Windows (fixes #139) - fix(version): default to 'official' instead of 'chinese' when source unknown - fix(version): reorder npm global package check based on active CLI
This commit is contained in:
@@ -52,21 +52,23 @@ const API_TYPES = SHARED_API_TYPES
|
||||
function normalizeApiType(raw) {
|
||||
const type = (raw || '').trim()
|
||||
if (type === 'anthropic' || type === 'anthropic-messages') return 'anthropic-messages'
|
||||
if (type === 'google-gemini') return 'google-gemini'
|
||||
if (type === 'google-gemini' || type === 'google-generative-ai') return 'google-generative-ai'
|
||||
if (type === 'ollama') return 'ollama'
|
||||
if (type === 'openai' || type === 'openai-completions' || type === 'openai-responses') return 'openai-completions'
|
||||
return 'openai-completions'
|
||||
}
|
||||
|
||||
function requiresApiKey(apiType) {
|
||||
const type = normalizeApiType(apiType)
|
||||
return type === 'anthropic-messages' || type === 'google-gemini'
|
||||
return type === 'anthropic-messages' || type === 'google-generative-ai'
|
||||
}
|
||||
|
||||
function apiHintText(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiHintOpenai'),
|
||||
'anthropic-messages': t('assistant.apiHintAnthropic'),
|
||||
'google-gemini': t('assistant.apiHintGemini'),
|
||||
'google-generative-ai': t('assistant.apiHintGemini'),
|
||||
'ollama': 'Ollama 原生 API,baseUrl 填 http://127.0.0.1:11434(不需要 /v1)',
|
||||
}[normalizeApiType(apiType)] || t('assistant.apiHintOpenai')
|
||||
}
|
||||
|
||||
@@ -74,7 +76,8 @@ function apiBasePlaceholder(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiBasePlaceholderOpenai'),
|
||||
'anthropic-messages': 'https://api.anthropic.com',
|
||||
'google-gemini': 'https://generativelanguage.googleapis.com/v1beta',
|
||||
'google-generative-ai': 'https://generativelanguage.googleapis.com/v1beta',
|
||||
'ollama': 'http://127.0.0.1:11434',
|
||||
}[normalizeApiType(apiType)] || 'https://api.openai.com/v1'
|
||||
}
|
||||
|
||||
@@ -82,7 +85,8 @@ function apiKeyPlaceholder(apiType) {
|
||||
return {
|
||||
'openai-completions': t('assistant.apiKeyPlaceholderOpenai'),
|
||||
'anthropic-messages': 'sk-ant-...',
|
||||
'google-gemini': 'AIza...',
|
||||
'google-generative-ai': 'AIza...',
|
||||
'ollama': 'ollama-local',
|
||||
}[normalizeApiType(apiType)] || 'sk-...'
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user