feat(web): chat over an upload opens with App.UploadChatModel
The Chatter's own default is the summarizer's (koala/phi4-mini, 8,192-token context), which answers HTTP 400 on an hour of speech. Empty keeps the old behaviour. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -117,6 +117,11 @@ type App struct {
|
|||||||
// recording. The caption default (18,000 chars, ~22 minutes of speech) would
|
// recording. The caption default (18,000 chars, ~22 minutes of speech) would
|
||||||
// keep only the first third of an hour-long meeting.
|
// keep only the first third of an hour-long meeting.
|
||||||
UploadChatMaxChars int
|
UploadChatMaxChars int
|
||||||
|
// UploadChatModel is the model chat over an uploaded recording opens with. Empty
|
||||||
|
// means the Chatter's own default. It exists because that default is the
|
||||||
|
// summarizer's (koala/phi4-mini, 8,192-token context) and cannot hold an hour of
|
||||||
|
// speech.
|
||||||
|
UploadChatModel string
|
||||||
// Processing tracks in-flight immediate summarizations so the status endpoint
|
// Processing tracks in-flight immediate summarizations so the status endpoint
|
||||||
// shows the animation until the summary lands. The zero value is ready to use.
|
// shows the animation until the summary lands. The zero value is ready to use.
|
||||||
Processing ProcessingSet
|
Processing ProcessingSet
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ func (a *App) handleUploadChat(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Redirect(w, r, "/uploads/"+u.ID, http.StatusSeeOther)
|
http.Redirect(w, r, "/uploads/"+u.ID, http.StatusSeeOther)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
a.render(w, r, UploadChatPage(*u, a.uploadChatView(*u, a.Chat.DefaultModel(""), nil, false, "")))
|
a.render(w, r, UploadChatPage(*u, a.uploadChatView(*u, a.Chat.DefaultModel(a.UploadChatModel), nil, false, "")))
|
||||||
}
|
}
|
||||||
|
|
||||||
// handleUploadChatMessage answers one question against the owner's uploaded
|
// handleUploadChatMessage answers one question against the owner's uploaded
|
||||||
@@ -226,7 +226,7 @@ func (a *App) handleUploadChatMessage(w http.ResponseWriter, r *http.Request) {
|
|||||||
http.Error(w, "bad form", http.StatusBadRequest)
|
http.Error(w, "bad form", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
model := a.resolveModel(r.FormValue("model"), "")
|
model := a.resolveModel(r.FormValue("model"), a.UploadChatModel)
|
||||||
history := parseHistory(r.Form["hq"], r.Form["ha"])
|
history := parseHistory(r.Form["hq"], r.Form["ha"])
|
||||||
question := strings.TrimSpace(r.FormValue("question"))
|
question := strings.TrimSpace(r.FormValue("question"))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user