From the course: Gemini API: Tool and Function Calling
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
API invocation best practices - Gemini Tutorial
From the course: Gemini API: Tool and Function Calling
API invocation best practices
- [Instructor] Aside employing best practices in crafting prompts for function calling operations, there are also standard practices for making sure that your function call requests are properly handled, and that's what we'll be looking at in this video, starting with model selection. When choosing your model for your application, use the smallest, fastest model like gemini-2.5-flash-lite or gemini-2.5-flash for tasks that rely heavily on tools. This is because the core logic of these operations is in your application and not the model's reasoning. Reserve powerful models like gemini-2.5-pro for complex multi-step compositional calls or deep reasoning tasks. This helps to reduce latency and token costs significantly. Next is to make sure that you're effectively using the context window. Be very mindful of the conversation history as every previous turn, including all function call and function response objects are sent back…