a77a16c494
Add support for object-style entries in fallback_models arrays, enabling per-model configuration of variant, reasoningEffort, temperature, top_p, maxTokens, and thinking settings. - Zod schema for FallbackModelObject with full validation - normalizeFallbackModels() and flattenToFallbackModelStrings() utilities - Provider-agnostic model resolution pipeline with fallback chain - Session prompt params state management - Fallback chain construction with prefix-match lookup - Integration across delegate-task, background-agent, and plugin layers
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
export type SessionPromptParams = {
|
|
temperature?: number
|
|
topP?: number
|
|
options?: Record<string, unknown>
|
|
}
|
|
|
|
const sessionPromptParams = new Map<string, SessionPromptParams>()
|
|
|
|
export function setSessionPromptParams(sessionID: string, params: SessionPromptParams): void {
|
|
sessionPromptParams.set(sessionID, {
|
|
...(params.temperature !== undefined ? { temperature: params.temperature } : {}),
|
|
...(params.topP !== undefined ? { topP: params.topP } : {}),
|
|
...(params.options !== undefined ? { options: { ...params.options } } : {}),
|
|
})
|
|
}
|
|
|
|
export function getSessionPromptParams(sessionID: string): SessionPromptParams | undefined {
|
|
const params = sessionPromptParams.get(sessionID)
|
|
if (!params) return undefined
|
|
|
|
return {
|
|
...(params.temperature !== undefined ? { temperature: params.temperature } : {}),
|
|
...(params.topP !== undefined ? { topP: params.topP } : {}),
|
|
...(params.options !== undefined ? { options: { ...params.options } } : {}),
|
|
}
|
|
}
|
|
|
|
export function clearSessionPromptParams(sessionID: string): void {
|
|
sessionPromptParams.delete(sessionID)
|
|
}
|
|
|
|
export function clearAllSessionPromptParams(): void {
|
|
sessionPromptParams.clear()
|
|
}
|