feat: upload audio, get a private Swedish transcript, discuss it (#33, ADR-033) #39
@@ -17,6 +17,7 @@ import (
|
|||||||
"git.d-ma.be/mathias/tapir/internal/adapters/chat"
|
"git.d-ma.be/mathias/tapir/internal/adapters/chat"
|
||||||
"git.d-ma.be/mathias/tapir/internal/adapters/store"
|
"git.d-ma.be/mathias/tapir/internal/adapters/store"
|
||||||
"git.d-ma.be/mathias/tapir/internal/domain"
|
"git.d-ma.be/mathias/tapir/internal/domain"
|
||||||
|
"git.d-ma.be/mathias/tapir/internal/errkind"
|
||||||
"git.d-ma.be/mathias/tapir/internal/uploads"
|
"git.d-ma.be/mathias/tapir/internal/uploads"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -134,7 +135,9 @@ func (a *App) uploadFailure(w http.ResponseWriter, r *http.Request, userID strin
|
|||||||
a.renderUploadsPage(w, r, userID, http.StatusRequestEntityTooLarge,
|
a.renderUploadsPage(w, r, userID, http.StatusRequestEntityTooLarge,
|
||||||
"This file is larger than the upload limit.")
|
"This file is larger than the upload limit.")
|
||||||
default:
|
default:
|
||||||
a.serverError(w, r, "upload", err)
|
// Not err: it can carry the file's name, a spool path or a database value.
|
||||||
|
a.logger().Error("upload failed", "kind", errkind.Of(err))
|
||||||
|
http.Error(w, "internal error", http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,7 +264,7 @@ func (a *App) handleUploadChatMessage(w http.ResponseWriter, r *http.Request) {
|
|||||||
MaxChars: a.UploadChatMaxChars,
|
MaxChars: a.UploadChatMaxChars,
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
a.logger().Error("upload chat answer", "upload", u.ID, "model", model, "err", err)
|
a.logger().Error("upload chat answer", "upload", u.ID, "model", model, "kind", errkind.Of(err))
|
||||||
view.Error = "That model couldn't answer just now. Try again, or switch models."
|
view.Error = "That model couldn't answer just now. Try again, or switch models."
|
||||||
} else {
|
} else {
|
||||||
view.History = appendTurn(history, chat.Turn{Question: question, Answer: reply.Answer})
|
view.History = appendTurn(history, chat.Turn{Question: question, Answer: reply.Answer})
|
||||||
|
|||||||
Reference in New Issue
Block a user