题意:
Google / 生成式 AI 调用函数无法正常工作。
问题背景:
I want to use function calling as tools in generative AI. Here are more details about function calling in Gemini and a correct structure of tool property.
我希望将函数调用用作生成式 AI 中的工具。以下是关于 Gemini 中函数调用的更多细节,以及工具属性的正确结构。
Function calling would allow Gemini to call functions instead of a text response, just like ChatGPT.
函数调用将允许 Gemini 调用函数,而非返回文本响应,这一点与 ChatGPT 类似。
I have written the following code: 我已编写以下代码:
import google.generativeai as genai
datas = {
\”contents\”: {
\”role\”: \”user\”,



