mirror of
https://github.com/Direct-Dev-Ru/go-lcg.git
synced 2026-11-09 17:06:40 +00:00
Исправления в ветке main
This commit is contained in:
@@ -88,7 +88,7 @@ func handleSaveResult(w http.ResponseWriter, r *http.Request) {
|
||||
|
||||
// Генерируем имя файла
|
||||
timestamp := time.Now().Format("2006-01-02_15-04-05")
|
||||
filename := fmt.Sprintf("gpt_request_%s_%s.md", req.Model, timestamp)
|
||||
filename := fmt.Sprintf("gpt_request_%s_%s.md", config.SafeFileName(req.Model), timestamp)
|
||||
filePath := path.Join(config.AppConfig.ResultFolder, filename)
|
||||
title := truncateTitle(req.Prompt)
|
||||
|
||||
|
||||
@@ -156,9 +156,11 @@ func handleExecute(w http.ResponseWriter, r *http.Request) {
|
||||
// getCommand выполняет запрос к AI
|
||||
func getCommand(gpt3 gpt.Gpt3, prompt string) (string, float64) {
|
||||
gpt3.InitKey()
|
||||
config.DebugLogf("[WEB-QUERY] %s", prompt)
|
||||
start := time.Now()
|
||||
response := gpt3.Completions(prompt)
|
||||
elapsed := time.Since(start).Seconds()
|
||||
config.DebugLogf("[TIMING] elapsed=%.2fs", elapsed)
|
||||
return response, elapsed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user