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 api检测能通过 但是对话始终报错 #4949

Open
flyhunterl opened this issue Dec 10, 2024 · 3 comments
Open

gemini api检测能通过 但是对话始终报错 #4949

flyhunterl opened this issue Dec 10, 2024 · 3 comments

Comments

@flyhunterl
Copy link

试过新建api也不行

{
"error": {
"message": "[GoogleGenerativeAI Error]: Error fetching from https://generativelanguage.googleapis.com/v1beta/models/gemini-exp-1206:streamGenerateContent?alt=sse: [400 ] Invalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[1].value': Cannot find field.\nInvalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[3].value': Cannot find field.\nInvalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[4].value': Cannot find field. [{"@type":"type.googleapis.com/google.rpc.BadRequest","fieldViolations":[{"field":"tools[0].function_declarations[2].parameters.properties[1].value","description":"Invalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[1].value': Cannot find field."},{"field":"tools[0].function_declarations[2].parameters.properties[3].value","description":"Invalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[3].value': Cannot find field."},{"field":"tools[0].function_declarations[2].parameters.properties[4].value","description":"Invalid JSON payload received. Unknown name "default" at 'tools[0].function_declarations[2].parameters.properties[4].value': Cannot find field."}]}]"
},
"provider": "google"
}

@lobehubbot
Copy link
Member

👀 @flyhunterl

Thank you for raising an issue. We will investigate into the matter and get back to you as soon as possible.
Please make sure you have given us as much context as possible.
非常感谢您提交 issue。我们会尽快调查此事,并尽快回复您。 请确保您已经提供了尽可能多的背景信息。

Copy link

dosubot bot commented Dec 10, 2024

The error you're encountering with the Gemini API is due to unsupported JSON schema properties like default in the function_declarations parameters. The Gemini API does not support these properties, which leads to the "Invalid JSON payload received" error. This issue is known and has been documented, indicating that the Gemini models cannot handle such schema properties, making certain plugins unusable [1][2].

There are similar discussions on this topic, such as the one titled "gemini api检查能过 但是聊天就报错" which is still open and might provide additional insights or solutions as they become available [3].

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@flyhunterl
Copy link
Author

解决了 禁用所有插件就好

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


The solution is to disable all plug-ins.

@SpeedupMaster
Copy link
Contributor

#4555
最近gemini兼容openai的请求格式了,通过oneapi使用gemini可以正常调用插件

@lobehubbot
Copy link
Member

Bot detected the issue body's language is not English, translate it automatically. 👯👭🏻🧑‍🤝‍🧑👫🧑🏿‍🤝‍🧑🏻👩🏾‍🤝‍👨🏿👬🏿


#4555
Recently, gemini is compatible with the request format of openai. Using gemini through oneapi, you can call the plug-in normally.

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

No branches or pull requests

3 participants