package web import ( "net/http" "time" "gitea.mynodes.xyz/ilker/llmgw/internal/store" ) type trainData struct { Nav Nav User store.User Models []string Projects []ChatContext CSRF string Version string Now string } // Train renders the page that customises a model: a file of questions and // answers, a model, a button, and the trainings of the person's projects. func Train(user store.User, models []string, projects []ChatContext, version string) http.HandlerFunc { return func(w http.ResponseWriter, r *http.Request) { noStore(w) render(w, r, "train", trainData{ Nav: navFrom(r, "train"), User: user, Models: models, Projects: projects, CSRF: csrfFor(r), Version: version, Now: time.Now().UTC().Format(time.RFC3339), }) } } // SetTrain has the menu offer the page while a model can be customised. // Asked on every page, so it must be cheap. func (p *AccountPages) SetTrain(available func() bool) { p.train = available }