Merge pull request #129 from Cooper-X-Oak/codex/fix-volcengine-seedasr-resource
fix(asr): 适配火山 2.0 资源 ID 并稳定保存凭据
This commit is contained in:
2 files changed
+8
-8
No files matched your search
@@ -40,7 +40,7 @@ pub struct VolcengineCredentials {
|
||||
|
||||
impl VolcengineCredentials {
|
||||
pub fn default_resource_id() -> &'static str {
|
||||
"volc.bigasr.sauc.duration"
|
||||
"volc.seedasr.sauc.duration"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@ mod tests {
|
||||
fn default_resource_id_is_sauc_duration() {
|
||||
assert_eq!(
|
||||
VolcengineCredentials::default_resource_id(),
|
||||
"volc.bigasr.sauc.duration"
|
||||
"volc.seedasr.sauc.duration"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -272,7 +272,7 @@ const LLM_PRESETS = [
|
||||
|
||||
type LlmPresetId = typeof LLM_PRESETS[number]['id'];
|
||||
|
||||
const ASR_DEFAULT_RESOURCE_ID = 'volc.bigasr.sauc.duration';
|
||||
const ASR_DEFAULT_RESOURCE_ID = 'volc.seedasr.sauc.duration';
|
||||
|
||||
// SiliconFlow ASR 暂未在后端实现(coordinator.rs 只路由 whisper / volcengine)。
|
||||
// 在后端接入前不暴露给用户,避免选了之后必然失败。重新启用见 issue #58 的 follow-up。
|
||||
@@ -569,8 +569,8 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
|
||||
statusRef.current = window.setTimeout(() => setStatus('idle'), 1600);
|
||||
};
|
||||
|
||||
const save = async (v: string) => {
|
||||
if (!loaded || !dirty) return;
|
||||
const save = async (v: string, force = false) => {
|
||||
if (!loaded || (!dirty && !force)) return;
|
||||
setStatus('saving');
|
||||
try {
|
||||
await setCredential(account, v);
|
||||
@@ -588,7 +588,7 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
|
||||
if (!loaded) return;
|
||||
setDirty(true);
|
||||
if (debounceRef.current) clearTimeout(debounceRef.current);
|
||||
debounceRef.current = setTimeout(() => save(v), 300);
|
||||
debounceRef.current = setTimeout(() => save(v, true), 300);
|
||||
};
|
||||
|
||||
const onBlur = () => {
|
||||
@@ -597,14 +597,14 @@ function CredentialField({ label, account, placeholder, mono, mask, defaultValue
|
||||
clearTimeout(debounceRef.current);
|
||||
debounceRef.current = null;
|
||||
}
|
||||
save(value);
|
||||
save(value, true);
|
||||
};
|
||||
|
||||
const fillDefault = async () => {
|
||||
if (!loaded || !defaultValue) return;
|
||||
setValue(defaultValue);
|
||||
setDirty(true);
|
||||
await save(defaultValue);
|
||||
await save(defaultValue, true);
|
||||
};
|
||||
|
||||
const onCopy = async () => {
|
||||
|
||||
Reference in new issue
Block a user