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

支持Gemini 聯網搜索調用 #615

Open
5 tasks done
123hi123 opened this issue Dec 12, 2024 · 15 comments
Open
5 tasks done

支持Gemini 聯網搜索調用 #615

123hi123 opened this issue Dec 12, 2024 · 15 comments
Labels
enhancement New feature or request

Comments

@123hi123
Copy link

123hi123 commented Dec 12, 2024

例行检查

  • 我已确认目前没有类似 issue
  • 我已确认我已升级到最新版本
  • 我已完整查看过项目 README,已确定现有版本无法满足需求
  • 我理解并愿意跟进此 issue,协助测试和提供反馈
  • 我理解并认可上述内容,并理解项目维护者精力有限,不遵循规则的 issue 可能会被无视或直接关闭

功能描述

可以聯網搜索的gemini模型
見:https://linux.do/t/topic/291469?u=joegodwanggod
应用场景
聯網搜索

@123hi123 123hi123 added the enhancement New feature or request label Dec 12, 2024
@Calcium-Ion
Copy link
Owner

Calcium-Ion commented Dec 12, 2024

目前暂时不知道该怎么支持,OpenAI的格式里没这个东西

@Calcium-Ion
Copy link
Owner

目前兼容了OpenAI格式下设置tools的调用方法

{
    "messages": [
        {
            "role": "user",
            "content": "今天北京天气如何"
        }
    ],
    "model": "gemini-2.0-flash-exp",
    "stream": false,
    "tools": [
        {
            "type": "function",
            "function": {
                "name": "googleSearch"
            }
        }
    ]
}

@Calcium-Ion Calcium-Ion pinned this issue Dec 12, 2024
@Calcium-Ion Calcium-Ion changed the title 支持Gemini 聯網搜索調用 包含gcp 支持Gemini 聯網搜索調用 Dec 12, 2024
@123hi123
Copy link
Author

好強 作者加油

@sabibi12
Copy link

现在测试这个功能发现开启tool后不能传图

@Calcium-Ion

This comment has been minimized.

@sabibi12

This comment has been minimized.

@Calcium-Ion

This comment has been minimized.

@Calcium-Ion
Copy link
Owner

现在测试这个功能发现开启tool后不能传图

看了一下官方说明开启搜索是仅支持文本的哈

@sabibi12
Copy link

现在测试这个功能发现开启tool后不能传图

看了一下官方说明开启搜索是仅支持文本的哈

好的,不过我在ai studio 上测试了能够同时传图和搜索,等后续跟进

@Calcium-Ion
Copy link
Owner

现在测试这个功能发现开启tool后不能传图

看了一下官方说明开启搜索是仅支持文本的哈

好的,不过我在ai studio 上测试了能够同时传图和搜索,等后续跟进

等gemini的api支持了就行,现在的代码没问题

@123hi123
Copy link
Author

作者有想到甚麼方法可以在owu當中加入tools嗎

@xmengnet
Copy link

作者有想到甚麼方法可以在owu當中加入tools嗎作者想到在 owu 中加入 tools 的方法嗎

https://linux.do/t/topic/419963/3 可以参考下这个

@123hi123
Copy link
Author

作者有想到甚麼方法可以在owu當中加入tools嗎作者想到在 owu 中加入 tools 的方法嗎

https://linux.do/t/topic/419963/3 可以参考下这个
多謝
這個確實有料

@sunqb
Copy link

sunqb commented Feb 20, 2025

联网都是应用侧增强实现的。我觉得可以参考火山大模型的这个逻辑:https://www.volcengine.com/docs/82379/1262342

但是我觉得更简单的是,参考下chrome插件:Page Assist的实现,其实也算是应用了:1、调用搜索api,可以自定义。2、返回的结果拼到提示词往后面传给大模型对话接口。

Image

Image

@123hi123
Copy link
Author

我在想能不能像是o1-high那樣給模型後面添加一個-search就能啟用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants