fatwang2 / sum4all

网页、视频、图片大模型总结
MIT License
264 stars 52 forks source link

文件总结-gemini代理不生效 #38

Closed kingdocker closed 6 months ago

kingdocker commented 6 months ago
  1. 问题描述:配置了Gemini来总结文件。发送文件后,报错代理建连失败。
  2. 详细日志: [INFO][2024-02-22 10:51:03][sum4all.py:181] - on_handle_context: 处理上下文开始 [INFO][2024-02-22 10:51:03][sum4all.py:184] - on_handle_context: 获取到文件路径 tmp/xx.pdf [INFO][2024-02-22 10:51:03][sum4all.py:756] - extract_content: 提取文件内容,文件路径: tmp/xx.pdf [INFO][2024-02-22 10:51:03][sum4all.py:759] - extract_content: 文件类型为 pdf [INFO][2024-02-22 10:51:03][sum4all.py:781] - extract_content: 文件内容提取完成 [INFO][2024-02-22 10:51:03][sum4all.py:678] - 开始读取PDF文件:tmp/xx.pdf [INFO][2024-02-22 10:51:03][sum4all.py:681] - PDF文件读取完成:tmp/xx.pdf [INFO][2024-02-22 10:51:03][sum4all.py:196] - Updated last_file_content in params_cache for user. [INFO][2024-02-22 10:51:03][sum4all.py:581] - handle_file: 向LLM发送内容总结请求 [ERROR][2024-02-22 10:51:04][sum4all.py:669] - Error calling OpenAI API: HTTPSConnectionPool(host='proxy.gemini.sum4all.one', port=443): Max retries exceeded with url: /v1/models/gemini-pro:generateContent (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f12bcbeeee0>: Failed to establish a new connection: [Errno -2] Name or service not known')) [INFO][2024-02-22 10:51:04][sum4all.py:202] - 文件 tmp/xx.pdf 已删除

服务器是国内ip,请问Gemini代理应该如何使用呢?

补充:Gemini的key没问题,之前通过对话调用正常。

fatwang2 commented 6 months ago

代理是我在代码里已经加了,不需要你额外配置,你目前是只有文件总结不能用吗?其他都ok?

kingdocker commented 6 months ago

代理是我在代码里已经加了,不需要你额外配置,你目前是只有文件总结不能用吗?其他都ok?

试了下:

fatwang2 commented 6 months ago

方便的话试试,文件总结在其他大模型下是否正常,比如openai、sum4all的

On Thu, Feb 22, 2024 at 11:12 AM kingdocker @.***> wrote:

代理是我在代码里已经加了,不需要你额外配置,你目前是只有文件总结不能用吗?其他都ok?

试了下:

  • url总结,可以,速度很快;
  • 搜索信息,也可以返回结果;
  • 发送文件总结,报错。试了pdf、docx格式,都一样的报错。

— Reply to this email directly, view it on GitHub https://github.com/fatwang2/sum4all/issues/38#issuecomment-1958579009, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSWAOCH4RIHB66RNSQ3YU2ZQTAVCNFSM6AAAAABDUE56NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYGU3TSMBQHE . You are receiving this because you commented.Message ID: @.***>

kingdocker commented 6 months ago
  1. 文件总结,用sum4all、openai分别测试了一次,结果正常。Gemini测试还是之前的报错。
  2. 把4种功能都替换成gemini再次测试:
    • 图片分析,失败: [INFO][2024-02-22 14:26:04][sum4all.py:208] - on_handle_context: 开始处理图片 [INFO][2024-02-22 14:26:04][sum4all.py:211] - on_handle_context: 获取到图片路径 tmp/240222-142604.png [INFO][2024-02-22 14:26:04][sum4all.py:221] - Updated last_image_base64 in params_cache for user. [INFO][2024-02-22 14:26:04][sum4all.py:849] - handle_gemini_image: 解析Gemini图像处理API的响应 [INFO][2024-02-22 14:26:04][sum4all.py:232] - 文件 tmp/240222-142604.png 已删除 [INFO][2024-02-22 14:26:04][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=An error occurred while processing Gemini API response: HTTPSConnectionPool(host='proxy.gemini.sum4all.one', port=443): Max retries exceeded with url: /v1/models/gemini-pro-vision:generateContent (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7f12bd5a01c0>: Failed to establish a new connection: [Errno -2] Name or service not known'))

💬5min内输入问+问题,可继续追问), receiver=@c00b13ab2b37bed5eda4714b66ac4846

💬5min内输入问+问题,可继续追问), receiver=@c00b13ab2b37bed5eda4714b66ac4846

[ERROR][2024-02-22 14:28:59][sum4all.py:393] - Error calling new combined api: 500 Server Error: Internal Server Error for url: https://ai.sum4all.site/ [INFO][2024-02-22 14:28:59][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=An error occurred: 500 Server Error: Internal Server Error for url: https://ai.sum4all.site/

💬5min内输入问+问题,可继续追问), receiver=@c00b13ab2b37bed5eda4714b66ac4846

  1. Gemini使用概况:
    • 搜问题、URL总结之前测试还是ok的,这次测试失败。多测了几次,感觉不太稳定。
    • 图片分析、文件总结,一直失败,没有成功过。
kingdocker commented 6 months ago

补充反馈测试过程中发现的一个新问题。。关于xunfei图片理解的:

首先发送一张图片,解析成功:

[INFO][2024-02-22 14:07:28][sum4all.py:208] - on_handle_context: 开始处理图片 [INFO][2024-02-22 14:07:28][sum4all.py:211] - on_handle_context: 获取到图片路径 tmp/240222-140728.png [INFO][2024-02-22 14:07:28][sum4all.py:221] - Updated last_image_base64 in params_cache for user. [INFO][2024-02-22 14:07:28][sum4all.py:894] - handle_xunfei_image_response: 解析讯飞图像处理API的响应 [INFO][2024-02-22 14:07:40][sum4all.py:939] - OpenAI API response content [INFO][2024-02-22 14:07:40][sum4all.py:232] - 文件 tmp/240222-140728.png 已删除 [INFO][2024-02-22 14:07:40][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=1. 图片展示了一个计算机程序的输出,该程序似乎是用Python编写的,并使用了一个名为poong的库。

  1. 输出显示了三个不同的模型(标记为A、B和C)在五个不同目标上的预测结果。每个模型对每个目标都有其预测的概率值。
  2. 对于每个目标和模型组合,都有一个最大概率值,这意味着这些是模型给出的最佳预测。
  3. 图片还包含了一些注释和代码片段,可能是用于解释或展示这个程序的功能。
  4. 整体上,这张图片似乎是关于机器学习模型预测的可视化展示,特别是关注于某个特定的任务或数据集。

💬5min内输入问+问题,可继续追问), receiver=@c00b13ab2b37bed5eda4714b66ac4846

紧接着再次发送了一张图片,解析失败:

[INFO][2024-02-22 14:08:18][sum4all.py:208] - on_handle_context: 开始处理图片 [INFO][2024-02-22 14:08:19][sum4all.py:211] - on_handle_context: 获取到图片路径 tmp/240222-140818.png [INFO][2024-02-22 14:08:19][sum4all.py:221] - Updated last_image_base64 in params_cache for user. [INFO][2024-02-22 14:08:19][sum4all.py:894] - handle_xunfei_image_response: 解析讯飞图像处理API的响应 [ERROR][2024-02-22 14:08:31][sum4all.py:948] - Error processing LLM API response: 504 Server Error: Gateway Timeout for url: https://spark.sum4all.site/v1/chat/completions [INFO][2024-02-22 14:08:31][sum4all.py:232] - 文件 tmp/240222-140818.png 已删除 [INFO][2024-02-22 14:08:31][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=An error occurred while processing LLM API response: 504 Server Error: Gateway Timeout for url: https://spark.sum4all.site/v1/chat/completions

💬5min内输入问+问题,可继续追问), receiver=@c00b13ab2b37bed5eda4714b66ac4846

请问有没有更详细的日志之类的,用以定位这样间歇失败的原因呢。

fatwang2 commented 6 months ago

方便加telegram 频道吗,详细聊一下

kingdocker @.***>于2024年2月22日 周四14:39写道:

补充反馈测试过程中发现的一个新问题。。关于xunfei图片理解的:

首先发送一张图片,解析成功:

[INFO][2024-02-22 14:07:28][sum4all.py:208] - on_handle_context: 开始处理图片 [INFO][2024-02-22 14:07:28][sum4all.py:211] - on_handle_context: 获取到图片路径 tmp/240222-140728.png [INFO][2024-02-22 14:07:28][sum4all.py:221] - Updated last_image_base64 in params_cache for user. [INFO][2024-02-22 14:07:28][sum4all.py:894] - handle_xunfei_image_response: 解析讯飞图像处理API的响应 [INFO][2024-02-22 14:07:40][sum4all.py:939] - OpenAI API response content [INFO][2024-02-22 14:07:40][sum4all.py:232] - 文件 tmp/240222-140728.png 已删除 [INFO][2024-02-22 14:07:40][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=1. 图片展示了一个计算机程序的输出,该程序似乎是用Python编写的,并使用了一个名为poong的库。

  1. 输出显示了三个不同的模型(标记为A、B和C)在五个不同目标上的预测结果。每个模型对每个目标都有其预测的概率值。
  2. 对于每个目标和模型组合,都有一个最大概率值,这意味着这些是模型给出的最佳预测。
  3. 图片还包含了一些注释和代码片段,可能是用于解释或展示这个程序的功能。
  4. 整体上,这张图片似乎是关于机器学习模型预测的可视化展示,特别是关注于某个特定的任务或数据集。

💬5min内输入问+问题,可继续追问), @.***

紧接着再次发送了一张图片,解析失败:

[INFO][2024-02-22 14:08:18][sum4all.py:208] - on_handle_context: 开始处理图片 [INFO][2024-02-22 14:08:19][sum4all.py:211] - on_handle_context: 获取到图片路径 tmp/240222-140818.png [INFO][2024-02-22 14:08:19][sum4all.py:221] - Updated last_image_base64 in params_cache for user. [INFO][2024-02-22 14:08:19][sum4all.py:894] - handle_xunfei_image_response: 解析讯飞图像处理API的响应 [ERROR][2024-02-22 14:08:31][sum4all.py:948] - Error processing LLM API response: 504 Server Error: Gateway Timeout for url: https://spark.sum4all.site/v1/chat/completions [INFO][2024-02-22 14:08:31][sum4all.py:232] - 文件 tmp/240222-140818.png 已删除 [INFO][2024-02-22 14:08:31][wechat_channel.py:191] - [WX] sendMsg=Reply(type=TEXT, content=An error occurred while processing LLM API response: 504 Server Error: Gateway Timeout for url: https://spark.sum4all.site/v1/chat/completions

💬5min内输入问+问题,可继续追问), @.***

请问有没有更详细的日志之类的,用以定位这样间歇失败的原因呢。

— Reply to this email directly, view it on GitHub https://github.com/fatwang2/sum4all/issues/38#issuecomment-1958802171, or unsubscribe https://github.com/notifications/unsubscribe-auth/A77NZSQGVCZMGFQTOJSTDRTYU3R27AVCNFSM6AAAAABDUE56NSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJYHAYDEMJXGE . You are receiving this because you commented.Message ID: @.***>

kingdocker commented 6 months ago

好的,晚上回去加下,谢谢大佬~

fatwang2 commented 6 months ago

我看你的日志请求的还是旧版本的接口,你当前插件升级到最新版了吗?可以管理员 plist 看下插件版本

kingdocker commented 6 months ago

我看你的日志请求的还是旧版本的接口,你当前插件升级到最新版了吗?可以管理员 plist 看下插件版本

还真是,v0.7.1。。。。下午还一直尝试修改.py文件里gemini的代理地址来着,原来是版本没对上。。 我先update下看看。。

kingdocker commented 6 months ago

升级版本后可以了!疏忽了这个细节,实在感谢大佬,辛苦了~~~~