Spaces:
Sleeping
Sleeping
prod ready
Browse files- api/chain.go +16 -16
api/chain.go
CHANGED
|
@@ -71,19 +71,19 @@ func extractResponse(responseContent string) string {
|
|
| 71 |
return responseContent
|
| 72 |
}
|
| 73 |
|
| 74 |
-
func writePromptToLogFile(prompt string) error {
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
}
|
|
|
|
| 71 |
return responseContent
|
| 72 |
}
|
| 73 |
|
| 74 |
+
// func writePromptToLogFile(prompt string) error {
|
| 75 |
+
// if _, err := os.Stat("./log"); os.IsNotExist(err) {
|
| 76 |
+
// os.Mkdir("./log", 0755)
|
| 77 |
+
// }
|
| 78 |
+
// file, err := os.OpenFile("./log/prompt.log", os.O_APPEND|os.O_CREATE|os.O_WRONLY, 0644)
|
| 79 |
+
// if err != nil {
|
| 80 |
+
// return fmt.Errorf("error opening log file: %v", err)
|
| 81 |
+
// }
|
| 82 |
+
// defer file.Close()
|
| 83 |
+
|
| 84 |
+
// if _, err := file.WriteString(prompt); err != nil {
|
| 85 |
+
// return fmt.Errorf("error writing to log file: %v", err)
|
| 86 |
+
// }
|
| 87 |
+
|
| 88 |
+
// return nil
|
| 89 |
+
// }
|