mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-24 12:44:18 +08:00
feat(opencode): add extra options editor for SDK configuration
Add key-value pair editor for configuring additional SDK options like timeout, setCacheKey, etc. Values are automatically parsed to appropriate types (number, boolean, object) on save. - Add `extra` field with serde flatten in Rust backend - Add index signature to OpenCodeProviderOptions type - Create ExtraOptionKeyInput component with local state pattern - Place extra options section above models configuration
This commit is contained in:
@@ -521,6 +521,11 @@ pub struct OpenCodeProviderOptions {
|
||||
/// 自定义请求头
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub headers: Option<HashMap<String, String>>,
|
||||
|
||||
/// 额外选项(timeout, setCacheKey 等)
|
||||
/// 使用 flatten 捕获所有未明确定义的字段
|
||||
#[serde(flatten, default, skip_serializing_if = "HashMap::is_empty")]
|
||||
pub extra: HashMap<String, Value>,
|
||||
}
|
||||
|
||||
/// OpenCode 模型定义
|
||||
|
||||
Reference in New Issue
Block a user