feat(config): support object-style fallback_models with per-model settings
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
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
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()
|
||||
}
|
||||
Reference in New Issue
Block a user