feat(model): 添加流式配置支持并优化响应处理

This commit is contained in:
2026-05-30 22:08:46 +08:00
parent 55eb436639
commit 1bcf8f6e10

View File

@@ -194,10 +194,10 @@ func fetchFileContent(ctx context.Context, client *http.Client, url string) (str
return strings.TrimSpace(string(body)), nil
}
// SkillMdContent 根据 skillName 获取 zip 内所有 md 文件拼接内容
func SkillMdContent(ctx context.Context, skillName string) string {
skillResp, err := gateway.GetSkillUser(ctx, skillName)
if err != nil {
g.Log().Warningf(ctx, "[SkillMd] GetSkillUser 失败: %v", err)
return ""
}
@@ -208,11 +208,13 @@ func SkillMdContent(ctx context.Context, skillName string) string {
zipBytes, err := downloadFile(client, fullUrl, maxSize)
if err != nil {
g.Log().Warningf(ctx, "[SkillMd] 下载失败 url=%s err=%v", fullUrl, err)
return ""
}
mdContents, err := extractMdFiles(ctx, zipBytes)
if err != nil || len(mdContents) == 0 {
g.Log().Warningf(ctx, "[SkillMd] 提取md失败 count=%d err=%v", len(mdContents), err)
return ""
}