mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
feat(chat,seahorse): persist and display model_name across history (#2897)
* feat(chat,seahorse): persist and display model_name across history * test(seahorse): fix lint regressions in repair coverage * fix(pico): preserve model_name in live updates * fix(pico): preserve model_name through live stream wrappers
This commit is contained in:
@@ -17,6 +17,7 @@ type FallbackChain struct {
|
||||
type FallbackCandidate struct {
|
||||
Provider string
|
||||
Model string
|
||||
DisplayName string // optional configured alias/raw model label for persistence/UI
|
||||
RPM int // requests per minute; 0 means unrestricted
|
||||
IdentityKey string // optional stable config identity for cooldown/rate limiting
|
||||
}
|
||||
@@ -32,10 +33,11 @@ func (c FallbackCandidate) StableKey() string {
|
||||
|
||||
// FallbackResult contains the successful response and metadata about all attempts.
|
||||
type FallbackResult struct {
|
||||
Response *LLMResponse
|
||||
Provider string
|
||||
Model string
|
||||
Attempts []FallbackAttempt
|
||||
Response *LLMResponse
|
||||
Provider string
|
||||
Model string
|
||||
IdentityKey string
|
||||
Attempts []FallbackAttempt
|
||||
}
|
||||
|
||||
// FallbackAttempt records one attempt in the fallback chain.
|
||||
@@ -85,8 +87,9 @@ func ResolveCandidatesWithLookup(
|
||||
}
|
||||
seen[key] = true
|
||||
candidates = append(candidates, FallbackCandidate{
|
||||
Provider: ref.Provider,
|
||||
Model: ref.Model,
|
||||
Provider: ref.Provider,
|
||||
Model: ref.Model,
|
||||
DisplayName: candidateRaw,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -187,6 +190,7 @@ func (fc *FallbackChain) Execute(
|
||||
result.Response = resp
|
||||
result.Provider = candidate.Provider
|
||||
result.Model = candidate.Model
|
||||
result.IdentityKey = candidate.StableKey()
|
||||
return result, nil
|
||||
}
|
||||
|
||||
@@ -305,6 +309,7 @@ func (fc *FallbackChain) ExecuteImage(
|
||||
result.Response = resp
|
||||
result.Provider = candidate.Provider
|
||||
result.Model = candidate.Model
|
||||
result.IdentityKey = candidate.StableKey()
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -86,6 +86,7 @@ type Attachment struct {
|
||||
type Message struct {
|
||||
Role string `json:"role"`
|
||||
Content string `json:"content"`
|
||||
ModelName string `json:"model_name,omitempty"`
|
||||
Media []string `json:"media,omitempty"`
|
||||
Attachments []Attachment `json:"attachments,omitempty"`
|
||||
ReasoningContent string `json:"reasoning_content,omitempty"`
|
||||
|
||||
Reference in New Issue
Block a user