Add session-level bridge model settings (#811)

This commit is contained in:
ekko
2026-05-17 12:20:53 +08:00
committed by GitHub
parent fa035f348e
commit 5e8f8bd4a1
35 changed files with 697 additions and 60 deletions
+2
View File
@@ -16,6 +16,8 @@ export interface StartRunRequest {
instructions?: string
session_id?: string
model?: string
provider?: string
model_groups?: Array<{ provider: string; models: string[] }>
queue_id?: string
source?: 'api_server' | 'cli'
}
@@ -4,6 +4,7 @@ export interface ConversationSummary {
id: string
source: string
model: string
provider?: string
title: string | null
started_at: number
ended_at: number | null
@@ -4,6 +4,7 @@ export interface SessionSummary {
id: string
source: string
model: string
provider?: string
title: string | null
preview?: string
started_at: number
@@ -147,6 +148,18 @@ export async function setSessionWorkspace(id: string, workspace: string | null):
}
}
export async function setSessionModel(id: string, model: string, provider: string): Promise<boolean> {
try {
await request(`/api/hermes/sessions/${id}/model`, {
method: 'POST',
body: JSON.stringify({ model, provider }),
})
return true
} catch {
return false
}
}
export async function exportSession(id: string, mode: 'full' | 'compressed' = 'full', ext: 'json' | 'txt' = 'json'): Promise<void> {
const baseUrl = getBaseUrlValue()
const token = getApiKey()