feat(web): helper naming the cloud provider of a transcript, one definition of local (#52)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,6 +18,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/config"
|
||||||
"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/errkind"
|
||||||
"git.d-ma.be/mathias/tapir/internal/uploads"
|
"git.d-ma.be/mathias/tapir/internal/uploads"
|
||||||
@@ -243,6 +244,17 @@ func titleFromFilename(name string) string {
|
|||||||
return t
|
return t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// cloudProvider names the cloud service that produced a transcript, or false when it was
|
||||||
|
// served locally (or by an unknown endpoint). "Local" is config.IsLocalModel: the same
|
||||||
|
// definition the start-up validation uses, not a second string match here (#52).
|
||||||
|
func cloudProvider(endpoint string) (string, bool) {
|
||||||
|
if endpoint == "" || config.IsLocalModel(endpoint) {
|
||||||
|
return "", false
|
||||||
|
}
|
||||||
|
provider, _, _ := strings.Cut(endpoint, "/")
|
||||||
|
return provider, true
|
||||||
|
}
|
||||||
|
|
||||||
// hasNote reports whether any phase carries a note. A note is the only warning for a
|
// hasNote reports whether any phase carries a note. A note is the only warning for a
|
||||||
// recording that is shorter than its file claimed, so a record that has one is shown open.
|
// recording that is shorter than its file claimed, so a record that has one is shown open.
|
||||||
func hasNote(steps []domain.ProgressStep) bool {
|
func hasNote(steps []domain.ProgressStep) bool {
|
||||||
|
|||||||
Reference in New Issue
Block a user