fix: 修复图片解析、角色Claim类型及错误日志问题
- 优化 Gemini 图片解析逻辑,递归遍历 JSON 并支持从 markdown 中提取图片 - 修复管理员角色 Claim 使用错误类型的问题,统一为 ClaimTypes.Role - 修正图片生成失败时日志内容,输出完整响应数据以便排查
This commit is contained in:
@@ -1080,7 +1080,7 @@ public class AiGateWayManager : DomainService
|
||||
var imagePrefixBase64 = GeminiGenerateContentAcquirer.GetImagePrefixBase64(data);
|
||||
if (string.IsNullOrWhiteSpace(imagePrefixBase64))
|
||||
{
|
||||
_logger.LogError($"图片生成解析失败,模型id:,请求信息:【{request}】,请求响应信息:{imagePrefixBase64}");
|
||||
_logger.LogError($"图片生成解析失败,模型id:,请求信息:【{request}】,请求响应信息:【{data}】");
|
||||
throw new UserFriendlyException("大模型没有返回图片,请调整提示词或稍后再试");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user