chatchat-space / Langchain-Chatchat

Langchain-Chatchat(原Langchain-ChatGLM)基于 Langchain 与 ChatGLM, Qwen 与 Llama 等语言模型的 RAG 与 Agent 应用 | Langchain-Chatchat (formerly langchain-ChatGLM), local knowledge based LLM (like ChatGLM, Qwen and Llama) RAG and Agent app with langchain
Apache License 2.0
31.84k stars 5.55k forks source link

[BUG] 上传图片识别识别(解析地址出错) #4876

Open pingyuan2016 opened 2 months ago

pingyuan2016 commented 2 months ago

问题描述 / Problem Description 使用最新版chatchat v3.1

basic 配置如下 image

上传图片,进行问答找的地址不对 image

后台日志 openai.BadRequestError: Error code: 400 - {'error': {'message': 'Invalid image.', 'type': 'invalid_request_error', 'param': None, 'code': 'invalid_image'}} 2024-08-28 11:29:47,298 httpx 850800 INFO HTTP Request: POST http://127.0.0.1:17861/chat/chat/completions "HTTP/1.1 500 Internal Server Error" 2024-08-28 11:29:47,299 openai._base_client 850800 INFO Retrying request to /chat/completions in 1.592874 seconds 2024-08-28 11:29:48.928 | WARNING | chatchat.server.api_server.chat_routes:chat_completions:201 - failed to add message to db: (sqlite3.InterfaceError) Error binding parameter 3 - probably unsupported type. [SQL: INSERT INTO message (id, conversation_id, chat_type, "query", response, meta_data, feedback_score, feedback_reason, create_time) VALUES (?, ?, ?, ?, ?, ?, ?, ?, CURRENT_TIMESTAMP) RETURNING create_time] [parameters: ('86d95e91f1184862b96f4685306917e9', 'aab1809322d0439299e93d01699a1595', 'llm_chat', ValidatorIterator(index=0, schema=Some(Union(UnionValidator { mode: Smart, choices: [(DefinitionRef(DefinitionRefValidator { definition: "typed-dict" ... (1722 characters truncated) ... ow, extras_validator: None, strict: false, loc_by_alias: true }), None)], custom_error: None, strict: false, name: "union[typed-dict,typed-dict]" }))), '', '{}', -1, '')] (Background on this error at: https://sqlalche.me/e/20/rvf5) 2024-08-28 11:29:51,243 httpx 850700 INFO HTTP Request: POST https://api.openai.com/v1/chat/completions "HTTP/1.1 400 Bad Request" INFO: 127.0.0.1:34006 - "POST /chat/chat/completions HTTP/1.1" 500 Internal Server Error

初步判断应该地址解析不对,怎么处理呢

liunux4odoo commented 2 months ago

4629 应该已经做了修复。你看下你的chatchat这一行代码是什么样的:

https://github.com/chatchat-space/Langchain-Chatchat/blob/1e7e6bb830a9dc6c6f074bc40eacad1c86f62e10/libs/chatchat-server/chatchat/webui_pages/dialogue/dialogue.py#L98

pingyuan2016 commented 2 months ago

这个确认过了,和你的一样 image

我是改了如下配置,链接才正常 image

但是还有个问题,图片不能识别,用的模型是gpt-4o,用的是界面openai那个通道 前端报错如下: image

后端报错如下: image

liunux4odoo commented 2 months ago

向 openai.com 的请求 400 了,你设置代理了吗?

pingyuan2016 commented 2 months ago

挂代理了,使用gpt-4o正常问答没问题,就上传图片不行

docShen commented 1 month ago

我也一模一样的问题,请问解决了吗? image

github-actions[bot] commented 3 weeks ago

这个问题已经被标记为 stale ,因为它已经超过 30 天没有任何活动。