新增: Agent 中继模式——u-relay 客户端接入远端 agent 指令链
This commit is contained in:
@@ -34,7 +34,8 @@ const PROTO_DEFAULTS: Record<string, { base: string; model: string }> = {
|
||||
const form = ref<AiCfg>({
|
||||
preset: 'zhipu', protocol: 'openai',
|
||||
base: '', key: '', model: '', proxy: '',
|
||||
imgBase: '', imgKey: '', imgModel: ''
|
||||
imgBase: '', imgKey: '', imgModel: '',
|
||||
relayUrl: '', relayToken: '', relayDeviceId: ''
|
||||
})
|
||||
|
||||
/** 从 store 读取并填充表单 */
|
||||
@@ -46,7 +47,10 @@ function loadFromStore() {
|
||||
base: c.base, key: c.key, model: c.model, proxy: c.proxy,
|
||||
imgBase: c.imgBase || '',
|
||||
imgKey: c.imgKey || '',
|
||||
imgModel: c.imgModel || ''
|
||||
imgModel: c.imgModel || '',
|
||||
relayUrl: c.relayUrl || '',
|
||||
relayToken: c.relayToken || '',
|
||||
relayDeviceId: c.relayDeviceId || ''
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +91,10 @@ function save() {
|
||||
proxy: form.value.proxy.trim(),
|
||||
imgBase: (form.value.imgBase || '').trim(),
|
||||
imgKey: (form.value.imgKey || '').trim(),
|
||||
imgModel: (form.value.imgModel || '').trim()
|
||||
imgModel: (form.value.imgModel || '').trim(),
|
||||
relayUrl: (form.value.relayUrl || '').trim(),
|
||||
relayToken: (form.value.relayToken || '').trim(),
|
||||
relayDeviceId: (form.value.relayDeviceId || '').trim()
|
||||
})
|
||||
const label = form.value.preset === 'custom'
|
||||
? (form.value.protocol === 'anthropic' ? 'Anthropic' : 'OpenAI') + ' 自定义'
|
||||
@@ -172,6 +179,23 @@ function save() {
|
||||
<input type="text" v-model="form.imgModel" placeholder="dall-e-3" />
|
||||
</div>
|
||||
|
||||
<div class="section-title">Agent 中继(可选,三项齐备即启用 Agent 模式)</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label>中继 URL</label>
|
||||
<input type="text" v-model="form.relayUrl" placeholder="wss://..." />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label>中继 Token</label>
|
||||
<input type="password" v-model="form.relayToken" placeholder="设备配对 Token" autocomplete="off" />
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<label>设备 ID</label>
|
||||
<input type="text" v-model="form.relayDeviceId" placeholder="device_id" />
|
||||
</div>
|
||||
|
||||
<div class="modal-actions">
|
||||
<button class="btn" @click="emit('close')">取消</button>
|
||||
<button class="btn primary" @click="save">保存</button>
|
||||
|
||||
Reference in New Issue
Block a user