Filtering out Max Remote Calls in Automatic Function Calling (AFC) warning

Today is another one of those days that I’ll just post without giving much background project information, as doing that will take too much time. But today was my first day as well on getting to know Gemini.

1. What is Gemini and Gemini API

(screenshots from https://gemini.google.com/app)

Gemini is Google’s most capable large language model (LLM). It’s multimodal, meaning it can understand and generate text, images, code, and more. Think of it as a very advanced AI that can assist you with a wide range of tasks.  

The Gemini API is a way for developers to access and use Gemini’s capabilities in their own applications. It allows them to integrate Gemini’s AI power into their software, websites, and other projects.  

Here’s a breakdown of what that means:

  • Gemini: The powerful AI model itself, capable of understanding and generating different kinds of content.  
  • Gemini API: A set of tools and protocols that developers use to connect their applications to Gemini.  

2. Google Cloud API Console https://console.cloud.google.com/apis

The Google Cloud API Console, now more commonly referred to as the Google Cloud Console, is a web-based interface that provides a central hub for managing your Google Cloud projects and resources. It’s the primary way developers and administrators interact with Google Cloud Platform (GCP).

3. Implementation

(screenshot from my current work)

I disabled the automatic function calling (AFC) (see https://ai.google.dev/gemini-api/docs/function-calling/tutorial), as it was causing unwanted warning messages such as these:

(without setting any AFC options/parameters)
(after only setting the AFC to false)
(after setting AFC to false and remote call number to 0)

There’s no good documentation as to why this is happening, or how to stop these warnings, and changing the settings only makes warnings longer. If disabling is somewhat expected for the users (developers), then there should be a better way (documentation or option) to suppress these messages. So I had to make a special filter for these:

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *