-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: show images from Bard's reply #102
Conversation
bb38211
to
27998fa
Compare
* Allow text with photos, see `RequestResponseContainer.response_images` * All captions are formatted in Markdown * Use `md2tgmd` to escape markdown content, keep the original format
Everything works for me regarding the generation of images by the Bard (except for the need to fix |
Fix formatting
Bing Image Generator stopped working for me
Error is here response_part \
= request_response.response[response_part_index_start:response_part_index_stop].strip() |
I tried to fix it. I can't use Bing on my server, so I didn't test this. I'm sorry. |
🙃🙃🙃
|
Pls wait, I'll trying to fix it now |
I need the image links from Bing to identify this problem. |
Saving images locally is also not good. Telegram can accept links as input. The only thing we need to do is avoid the |
The problem I'm facing is that some links returned from Bard are not valid images or supported image formats. Maybe we can use |
Fixed. Tested on my local machine. |
Now i'm getting responses from Bard like this 🙃 Me: Bard: |
It seems like the image source from Bard blocked access from a bot. I'm trying to add User-Agent for requests, which seems to work. I'm fixing the problem, which image might be too big. I will push my code later. |
I've updated a few things including image logging. Tested on Bard and BingImageGen |
Ok I'll wait until u fix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent solution for checking image format 👍
Maybe these graphs have base url to retrieve these type of images |
{
"content": "Sure, here is the graph:\n[image-tag: code_execution_image_1_1702151707.76185.png]",
"conversation_id": "c_b1ce829e646419c2",
"response_id": "r_36009817021c94c2",
"factuality_queries": null,
"text_query": "",
"choices": [
{
"id": "rc_1bee96994a572ecc",
"content": [
"Sure, here is the graph:\n[image-tag: code_execution_image_1_1702151707.76185.png]"
]
}
],
"links": [
"https://lh3.googleusercontent.com/bard/AL4VpuO_LqC_HH8q4ODUXBxrX3LVGQZ846eEEBKA7nDEMS8fFSvL6MBUmg87qeSq4X54UsmAHGgTzKQVFsJIXGSUrIebaWPgOZenNvxZNwG_tLTM-15zylBp3FD0xt4-Zvl6rqkpBRdcRNZ9rdY8PWBa3IrXDJAJ2z3Cy5jmDSSeQX9pHM7me3xH1e7nVvPLfJdYGzXQZ5kwAi2W1us0lDfonIe9cAq-cdcOTkDEkWDQimMGARl2HBCdk-bBIg9aQe68KokSjAviTJs3Nl3HR1yxgf2FMtSL1JI6J5FZoW97KFVVIv_TRrRg1pCxOYVUuQT6cvyPNeI1EvxVRNaA-Ls"
],
"images": [],
"program_lang": null,
"code": null,
"status_code": 200
} Here is the response from Bard. As you can see, the image URL is in the |
I can do that from my browser. It seems it needs my cookies to access the URL. |
OK |
Yes |
No description provided.