feat(cmd): wireUploads -- limits, chat budget and chat model into the web App
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -12,6 +12,7 @@ import (
|
|||||||
"git.d-ma.be/mathias/tapir/internal/adapters/transcribe"
|
"git.d-ma.be/mathias/tapir/internal/adapters/transcribe"
|
||||||
"git.d-ma.be/mathias/tapir/internal/config"
|
"git.d-ma.be/mathias/tapir/internal/config"
|
||||||
"git.d-ma.be/mathias/tapir/internal/uploads"
|
"git.d-ma.be/mathias/tapir/internal/uploads"
|
||||||
|
"git.d-ma.be/mathias/tapir/internal/web"
|
||||||
)
|
)
|
||||||
|
|
||||||
// uploadsStore is the store surface the upload wiring needs. *store.Store
|
// uploadsStore is the store surface the upload wiring needs. *store.Store
|
||||||
@@ -83,3 +84,17 @@ func removeSpooledAudio(dir string, log *slog.Logger) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// wireUploads connects a built Intake to the web App: the routes, the limits the
|
||||||
|
// form states, and the chat settings for an uploaded recording. A nil intake
|
||||||
|
// leaves the App untouched — assigning a nil *Intake to the Uploader interface
|
||||||
|
// would produce a non-nil interface and mount the routes over nothing.
|
||||||
|
func wireUploads(app *web.App, cfg config.Config, in *uploads.Intake) {
|
||||||
|
if in == nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
app.Uploads = in
|
||||||
|
app.UploadLimits = uploadLimits(cfg)
|
||||||
|
app.UploadChatMaxChars = cfg.MaxUploadedTranscriptChars
|
||||||
|
app.UploadChatModel = cfg.UploadChatModel
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user