init: api-gateway v2.4.0(Agnes/b.ai/火山方舟 三家供应商网关)
This commit is contained in:
commit
6cc65ff76f
91 files changed
+24653
No files matched your search
@@ -0,0 +1,26 @@
|
||||
// 设置页工具层 —— 对话默认参数,统一读写 localStorage。
|
||||
// 注:主题(A/B/C + 跟随系统)已独立到 lib/theme.ts;这里只管参数。
|
||||
|
||||
export interface ChatDefaults {
|
||||
model?: string
|
||||
temperature?: number
|
||||
top_p?: number
|
||||
max_tokens?: number | null
|
||||
stream?: boolean
|
||||
system?: string
|
||||
}
|
||||
|
||||
const DEFAULTS_KEY = 'gw_chat_defaults'
|
||||
|
||||
export function getChatDefaults(): ChatDefaults {
|
||||
try {
|
||||
const raw = localStorage.getItem(DEFAULTS_KEY)
|
||||
return raw ? (JSON.parse(raw) as ChatDefaults) : {}
|
||||
} catch {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
|
||||
export function setChatDefaults(d: ChatDefaults): void {
|
||||
localStorage.setItem(DEFAULTS_KEY, JSON.stringify(d))
|
||||
}
|
||||
Reference in new issue
Block a user