Исправления в ветке main

This commit is contained in:
2026-10-22 12:42:32 +06:00
parent 933e5ccb58
commit 9b05edc263
31 changed files with 2433 additions and 114 deletions

View File

@@ -19,6 +19,10 @@ func pathJoin(base, name string) string {
}
func writeFile(filePath, content string) {
if err := os.MkdirAll(path.Dir(filePath), 0755); err != nil {
fmt.Println("Failed to create result folder:", err)
return
}
if err := os.WriteFile(filePath, []byte(content), 0644); err != nil {
fmt.Println("Failed to save response:", err)
} else {
@@ -28,7 +32,7 @@ func writeFile(filePath, content string) {
func saveResponse(response string, gpt3Model string, prompt string, cmd string, explanation ...string) {
timestamp := nowTimestamp()
filename := fmt.Sprintf("gpt_request_%s_%s.md", gpt3Model, timestamp)
filename := fmt.Sprintf("gpt_request_%s_%s.md", config.SafeFileName(gpt3Model), timestamp)
filePath := pathJoin(config.AppConfig.ResultFolder, filename)
title := truncateTitle(cmd)