Skip to content
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

🐛 fix: Gemini cannot input images when server database is enabled #3370

Merged
merged 8 commits into from
Sep 9, 2024

Conversation

sxjeru
Copy link
Contributor

@sxjeru sxjeru commented Jul 31, 2024

💻 变更类型 | Change Type

  • ✨ feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • ⚡️ perf
  • 📝 docs

🔀 变更说明 | Description of Change

作为一种解决方案,简单将 image url 转为 base64 提交。经测试可正常使用。
应该也避免了数据库存图,存的仍然是图片链接。

代码比较粗糙,应该还能优化,望提出修改意见。

📝 补充信息 | Additional Information

fix #3051

Copy link

vercel bot commented Jul 31, 2024

@sxjeru is attempting to deploy a commit to the LobeHub Pro Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codecov bot commented Jul 31, 2024

Codecov Report

Attention: Patch coverage is 82.60870% with 8 lines in your changes missing coverage. Please review.

Project coverage is 91.68%. Comparing base (29bced1) to head (d9b8e3b).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
src/utils/imageToBase64.ts 56.25% 7 Missing ⚠️
src/libs/agent-runtime/google/index.ts 96.66% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3370      +/-   ##
==========================================
- Coverage   91.81%   91.68%   -0.14%     
==========================================
  Files         454      455       +1     
  Lines       30350    30414      +64     
  Branches     2096     2940     +844     
==========================================
+ Hits        27866    27884      +18     
- Misses       2484     2530      +46     
Flag Coverage Δ
app 91.68% <82.60%> (-0.14%) ⬇️
server 97.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fashioncj
Copy link

我建议是将这个作为一个配置项独立出来,让用户配置模型的图片发送方式。server database如果私有化部署(S3使用minio不允许外部可读),那openai等接口也不能使用~

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Sep 9, 2024
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:M This PR changes 30-99 lines, ignoring generated files. labels Sep 9, 2024
Copy link

vercel bot commented Sep 9, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lobe-chat-database ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 6:41pm
lobe-chat-preview ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 6:41pm

@arvinxx arvinxx merged commit eb552d2 into lobehub:main Sep 9, 2024
7 of 8 checks passed
github-actions bot pushed a commit that referenced this pull request Sep 9, 2024
### [Version&nbsp;1.15.29](v1.15.28...v1.15.29)
<sup>Released on **2024-09-09**</sup>

#### 🐛 Bug Fixes

- **misc**: Gemini cannot input images when server database is enabled.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### What's fixed

* **misc**: Gemini cannot input images when server database is enabled, closes [#3370](#3370) ([eb552d2](eb552d2))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
@sxjeru sxjeru deleted the google2 branch September 10, 2024 00:47
github-actions bot pushed a commit to bentwnghk/lobe-chat that referenced this pull request Sep 10, 2024
### [Version&nbsp;1.58.15](v1.58.14...v1.58.15)
<sup>Released on **2024-09-10**</sup>

#### ♻ Code Refactoring

- **misc**: Refactor brand implement for better custom.

#### 🐛 Bug Fixes

- **misc**: Baichuan should not introduce `freequency_penality` parameters, fix `/etc/resolv.conf`edit permission in docker image, fix claude 3.5 image with s3 url, fix tools calling in some edge cases, Gemini cannot input images when server database is enabled, Update baichuan param.

#### 💄 Styles

- **misc**: Add siliconcloud new model.

<br/>

<details>
<summary><kbd>Improvements and Fixes</kbd></summary>

#### Code refactoring

* **misc**: Refactor brand implement for better custom, closes [lobehub#3868](https://github.com/bentwnghk/lobe-chat/issues/3868) ([815b366](815b366))

#### What's fixed

* **misc**: Baichuan should not introduce `freequency_penality` parameters, closes [lobehub#3871](https://github.com/bentwnghk/lobe-chat/issues/3871) ([66a061e](66a061e))
* **misc**: Fix `/etc/resolv.conf`edit permission in docker image, closes [lobehub#3880](https://github.com/bentwnghk/lobe-chat/issues/3880) ([fdaa190](fdaa190))
* **misc**: Fix claude 3.5 image with s3 url, closes [lobehub#3870](https://github.com/bentwnghk/lobe-chat/issues/3870) ([89c8dd4](89c8dd4))
* **misc**: Fix tools calling in some edge cases, closes [lobehub#3872](https://github.com/bentwnghk/lobe-chat/issues/3872) ([2ed759d](2ed759d))
* **misc**: Gemini cannot input images when server database is enabled, closes [lobehub#3370](https://github.com/bentwnghk/lobe-chat/issues/3370) ([eb552d2](eb552d2))
* **misc**: Update baichuan param, closes [lobehub#3356](https://github.com/bentwnghk/lobe-chat/issues/3356) ([29bced1](29bced1))

#### Styles

* **misc**: Add siliconcloud new model, closes [lobehub#3865](https://github.com/bentwnghk/lobe-chat/issues/3865) ([c6b5a45](c6b5a45))

</details>

<div align="right">

[![](https://img.shields.io/badge/-BACK_TO_TOP-151515?style=flat-square)](#readme-top)

</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] 服务端 db 模式中,gemini 不支持直接传图片 url
3 participants