Ink-Osier / PandoraToV1Api

站在巨人的肩膀上的项目,感谢zhile大佬的Pandora-Next项目
517 stars 106 forks source link

感谢大佬支持了bot模式。不过有一个疑问 #22

Closed spacex-3 closed 6 months ago

spacex-3 commented 6 months ago

在让机器人画图且用gpt-4-mobile模型的情况下,他返回的消息已经不带图片的upload地址了,可否设置如果是画图upload的地址继续保留,而search的链接来源删除了。

返回的消息如:

{"size":"1024x1024","prompt":"A festive greeting card for the Winter Solstice. The card features a serene winter landscape with snow-covered trees and a small, cozy cottage with smoke rising from its chimney. In the foreground, a family of snowmen stands, wearing scarves and hats, symbolizing warmth and togetherness. The sky is clear and starry, suggesting a peaceful winter night. The words 'Happy Winter Solstice' are elegantly written at the top of the card in a decorative font, with a touch of glitter to make the text stand out. The overall tone is warm, inviting, and celebratory, capturing the spirit of the Winter Solstice."}


Here is a festive greeting card created for the Winter Solstice. I hope it captures the warmth and celebratory spirit of the occasion!

希望保留图片生成地址/文档地址
Ink-Osier commented 6 months ago

关于这个如果响应了在微信或者qq不也没办法展示么

spacex-3 commented 6 months ago

是,但是我设置的反代的域名可以直接在微信点开查看图片呢~

Ink-Osier commented 6 months ago

嗯 主要是有点丑,我想想这个怎么给你单独一个功能吧,可以单独给这个开一个环境变量也许?

Ink-Osier commented 6 months ago

该功能已支持,请拉取最新版试用(最新版目录结构有所改变,请注意)

spacex-3 commented 6 months ago
"bot_mode": {
    "enabled": "true",
    "enabled_markdown_image_output": "true",
    "enabled_bing_reference_output": "true",
    "enabled_plugin_output": "false"

这样设置 之后,bot依然没有链接:

image
Ink-Osier commented 6 months ago

看一下access日志里有没有报错什么的

spacex-3 commented 6 months ago

`023-12-24 06:41:25,533 [INFO] - New Request 2023-12-24 06:41:25,534 [INFO] - api_key: ** 2023-12-24 06:41:25,535 [INFO] - model: gpt-4 2023-12-24 06:41:25,535 [INFO] - 原模型名: gpt-4-mobile 2023-12-24 06:41:25,535 [DEBUG] - payload: {'action': 'next', 'messages': [{'id': '**', 'author': {'role': 'system'}, 'content': {'content_type': 'text', 'parts': ['你是一个人工智能助手']}, 'metadata': {}}, {'id': ‘, 'author': {'role': 'user'}, 'content': {'content_type': 'text', 'parts': ['你好']}, 'metadata': {}}, {'id': ‘’, 'author': {'role': 'user'}, 'content': {'content_type': 'text', 'parts': ['帮我画一个圣诞老人真人版本的在送礼物']}, 'metadata': {}}, {'id': ‘’, 'author': {'role': 'user'}, 'content': {'content_type': 'text', 'parts': ['帮我画一个圣诞老人真人版本的在送礼物']}, 'metadata': {}}, {'id': '', 'author': {'role': 'user'}, 'content': {'content_type': 'text', 'parts': ['帮我画一个圣诞老人真人版本在天空中送礼物']}, 'metadata': {}}], 'parent_message_id': '', 'model': 'gpt-4-mobile', 'timezone_offset_min': -480, 'suggestions': ['Give me 3 ideas about how to plan good New Years resolutions. Give me some that are personal, family, and professionally-oriented.', 'Write a text asking a friend to be my plus-one at a wedding next month. I want to keep it super short and casual, and offer an out.', 'Design a database schema for an online merch store.', 'Compare Gen Z and Millennial marketing strategies for sunglasses.'], 'history_and_training_disabled': False, 'conversation_mode': {'kind': 'primary_assistant'}, 'force_paragen': False, 'force_rate_limit': False} 2023-12-24 06:41:25,539 [DEBUG] - Starting new HTTP connection (1): 172.17.0.1:8181 2023-12-24 06:41:26,448 [DEBUG] - http://172.17.0.1:8181 "POST /prefix/backend-api/conversation HTTP/1.1" 200 None content_type: text last_content_type: None content_type: text last_content_type: None content_type: text last_content_type: None content_type: text last_content_type: None content_type: text last_content_type: None content_type: text last_content_type: None content_type: code last_content_type: None 2023-12-24 06:41:26,454 [INFO] - 发送消息: 2023-12-24 06:41:26,455 [DEBUG] - message 为空: data_json: {'conversation_id': '', 'message_id': '', 'is_completion': False, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': ''}} content_type: None last_content_type: code 2023-12-24 06:41:26,455 [INFO] - 当前会话id: 2023-12-24 06:41:26,455 [INFO] - 发送消息: content_type: code last_content_type: code 2023-12-24 06:41:26,456 [INFO] - 发送消息: content_type: code last_content_type: code

···

2023-12-24 06:41:29,237 [INFO] - 发送消息: content_type: code last_content_type: code content_type: code last_content_type: code content_type: code last_content_type: code content_type: multimodal_text last_content_type: code 2023-12-24 06:41:42,824 [DEBUG] - find img message~ 2023-12-24 06:41:42,824 [DEBUG] - asset_pointer: file-tNtxe3VAFgbP9cvoZnvpwBg7 2023-12-24 06:41:42,827 [DEBUG] - Starting new HTTP connection (1): 172.17.0.1:8181 2023-12-24 06:41:42,933 [DEBUG] - http://172.17.0.1:8181 "GET /prefix/backend-api/files/file-tNtxe3VAFgbP9cvoZnvpwBg7/download HTTP/1.1" 200 457 2023-12-24 06:41:42,934 [DEBUG] - download_url: https://files.oaiusercontent.com/file-tNtxe3VAFgbP9cvoZnvpwBg7?se=2023-12-24T06%3A46%3A42Z&sp=r&sv=2021-08-06&sr=b&rscc=max-age%3D31536000%2C%20immutable&rscd=attachment%3B%20filename%3Da88d9dd1-ffb1-4adc-b523-d2df699966fd.webp&sig=mwL5W%2BX/L3e3eSfkEEwey5nBq7v9U8aX9rT4IuH1d2U%3D 2023-12-24 06:41:42,939 [DEBUG] - Starting new HTTPS connection (1): files.oaiusercontent.com:443 2023-12-24 06:41:43,064 [DEBUG] - https://files.oaiusercontent.com:443 "GET /file-tNtxe3VAFgbP9cvoZnvpwBg7?se=2023-12-24T06%3A46%3A42Z&sp=r&sv=2021-08-06&sr=b&rscc=max-age%3D31536000%2C%20immutable&rscd=attachment%3B%20filename%3Da88d9dd1-ffb1-4adc-b523-d2df699966fd.webp&sig=mwL5W%2BX/L3e3eSfkEEwey5nBq7v9U8aX9rT4IuH1d2U%3D HTTP/1.1" 200 664688 2023-12-24 06:41:43,078 [DEBUG] - 下载图片成功 2023-12-24 06:41:43,078 [DEBUG] - 完整的文件路径: images/image_20231224064143.png content_type: text last_content_type: multimodal_text content_type: text last_content_type: multimodal_text content_type: text last_content_type: text content_type: text last_content_type: text content_type: text last_content_type: text 2023-12-24 06:41:43,829 [DEBUG] - 保存图片成功: image_20231224064143.png 2023-12-24 06:41:43,831 [DEBUG] - new_text: 2023-12-24 06:41:43,831 [INFO] - 发送消息: 2023-12-24 06:41:43,831 [DEBUG] - 无视消息: 2023-12-24 06:41:43,832 [INFO] - 发送消息: 2023-12-24 06:41:43,832 [INFO] - 发送消息: Here 2023-12-24 06:41:43,833 [INFO] - 发送消息: is 2023-12-24 06:41:43,833 [INFO] - 发送消息: the content_type: text last_content_type: text 2023-12-24 06:41:43,927 [INFO] - 发送消息: image content_type: text last_content_type: text 2023-12-24 06:41:44,063 [INFO] - 发送消息: of content_type: text last_content_type: text 2023-12-24 06:41:44,079 [INFO] - 发送消息: a content_type: text last_content_type: text 2023-12-24 06:41:44,101 [INFO] - 发送消息: realistic content_type: text last_content_type: text 2023-12-24 06:41:44,132 [INFO] - 发送消息: Santa content_type: text last_content_type: text 2023-12-24 06:41:44,144 [INFO] - 发送消息: Claus content_type: text last_content_type: text 2023-12-24 06:41:44,169 [INFO] - 发送消息: delivering content_type: text last_content_type: text 2023-12-24 06:41:44,186 [INFO] - 发送消息: gifts content_type: text last_content_type: text 2023-12-24 06:41:44,214 [INFO] - 发送消息: in content_type: text last_content_type: text 2023-12-24 06:41:44,233 [INFO] - 发送消息: the content_type: text last_content_type: text 2023-12-24 06:41:44,260 [INFO] - 发送消息: sky content_type: text last_content_type: text 2023-12-24 06:41:44,272 [INFO] - 发送消息: , content_type: text last_content_type: text 2023-12-24 06:41:44,293 [INFO] - 发送消息: as content_type: text last_content_type: text 2023-12-24 06:41:44,320 [INFO] - 发送消息: you content_type: text last_content_type: text 2023-12-24 06:41:44,337 [INFO] - 发送消息: requested content_type: text last_content_type: text 2023-12-24 06:41:44,359 [INFO] - 发送消息: . content_type: text last_content_type: text content_type: text last_content_type: text content_type: text last_content_type: text 2023-12-24 06:41:44,645 [DEBUG] - message 为空: data_json: {'conversation_id': '', 'message_id': '', 'is_completion': True, 'moderation_response': {'flagged': False, 'blocked': False, 'moderation_id': ''}} content_type: None last_content_type: text 2023-12-24 06:41:44,645 [INFO] - 发送消息: 2023-12-24 06:41:44,683 [INFO] - 发送数据: data: [DONE] 2023-12-24 06:41:44,683 [INFO] - 会话结束 2023-12-24 06:41:44,684 [INFO] - 完整消息: Here is the image of a realistic Santa Claus delivering gifts in the sky, as you requested. 2023-12-24 06:41:44,684 [DEBUG] - 会话结束-外层 2023-12-24 06:41:45,474 [INFO] - 准备删除的会话id: 2023-12-24 06:41:45,479 [DEBUG] - Starting new HTTP connection (1): 172.17.0.1:8181 2023-12-24 06:41:45,653 [DEBUG] - http://172.17.0.1:8181 "PATCH /prefix/backend-api/conversation/ HTTP/1.1" 200 16 2023-12-24 06:41:45,654 [INFO] - 删除会话 成功 172.19.0.1 - - [24/Dec/2023:06:41:45 +0000] "POST /prefix/v1/chat/completions HTTP/1.1" 200 390 "-" "OpenAI/v1 PythonBindings/0.27.8" `

日志如上,中间删减了很多重复的

Ink-Osier commented 6 months ago

感谢,我检查一下代码这部分

Ink-Osier commented 6 months ago

确实是bug,已经定位问题了,晚点会发一版解决这个问题,感谢

Ink-Osier commented 6 months ago

0.3.1和latest最新版的镜像已经推送了,可以先试试,问题应该解决了,晚点再发release

spacex-3 commented 6 months ago

可以了,很强!

image
Ink-Osier commented 6 months ago

可以在关注一下待会发的版本,打算待会再发一个0.3.2,图片在机器人模式下还要输出图片的话增加一个配置项可以支持不显示为markdown格式而是“图片链接: https://xxxxxxx”这样

spacex-3 commented 6 months ago

感谢~已经很完美了哈哈,精益求精

Ink-Osier commented 6 months ago

哈哈力求完美

Ink-Osier commented 6 months ago

image

感受一下hh