MCPcopy Create free account
hub / github.com/BlueSkyXN/AI2API / saveFullResponseForAnalysis

Function saveFullResponseForAnalysis

wo2api.go:2331–2345  ·  view source on GitHub ↗

保存完整响应内容以便后续分析

(bodyBytes []byte, reqID string)

Source from the content-addressed store, hash-verified

2329
2330// 保存完整响应内容以便后续分析
2331func saveFullResponseForAnalysis(bodyBytes []byte, reqID string) {
2332analyzeDir := "analysis"
2333os.MkdirAll(analyzeDir, 0755)
2334
2335// 创建文件名
2336filename := filepath.Join(analyzeDir, fmt.Sprintf("failed_response_%s.txt", reqID))
2337
2338// 写入原始内容
2339if err := os.WriteFile(filename, bodyBytes, 0644); err != nil {
2340 logError("[reqID:%s] 保存分析文件失败: %v", reqID, err)
2341 return
2342}
2343
2344logInfo("[reqID:%s] 已保存完整响应内容到文件: %s,请检查分析", reqID, filename)
2345}
2346
2347// 获取两个整数中的最小值
2348func min(a, b int) int {

Callers

nothing calls this directly

Calls 2

logErrorFunction · 0.70
logInfoFunction · 0.70

Tested by

no test coverage detected