Building Agent Workflows with Gemini 2.5 Pro—Does It Hold Up?

Prompt EngineeringAbout 6 min readMar 27, 2025Watch original
THE SUMMARYAI-generated

Key Concepts:

  • Gemini 2.5 Pro: A new language model with improved benchmarks, coding abilities, and a large context window.
  • Function Calling: The ability of an LLM to use external tools or functions to answer user queries.
  • Parallel Function Calls: Executing multiple function calls simultaneously to gather information from different sources.
  • Text-to-SQL: Converting natural language queries into SQL queries to interact with databases.
  • Agentic Systems: Systems where LLMs act as agents, using tools and functions to achieve specific goals.
  • System Prompt: Instructions given to the LLM to guide its behavior and define its role.
  • Chain of Thought: The internal reasoning process of the LLM, showing how it arrived at a particular answer.

1. Gemini 2.5 Pro Overview and Benchmarks

  • Gemini 2.5 Pro is presented as a high-performing language model, exceeding previous models in benchmarks, particularly on the Live Bench.
  • Independent benchmarks confirm the model's strong coding capabilities, as demonstrated by its performance on the Polyglot ADER benchmark.
  • The model is available for free via AI Studio, with a knowledge cutoff date of January 2025.
  • API limitations include a rate limit of 5 requests per minute or 50 requests per day.
  • The model boasts a large context window, accepting up to 1 million input tokens and generating up to 65,000 output tokens.
  • The API does not provide the chain of thought for responses, potentially to prevent model training on the reasoning process.

2. Basic Function Calling

  • Function calling allows an LLM to interact with external tools to gather information or perform actions.
  • The typical function calling flow involves the LLM determining if a tool is needed, selecting the appropriate tool, generating inputs for the tool, receiving a response, and generating a final response to the user.
  • The Gemini SDK for Python automates function calling but also allows for manual control.
  • A simple example is provided using a get_current_weather function that returns hardcoded weather data for specific locations (San Francisco, New York) or a default response for other locations.
  • The function includes a docstring that describes its purpose and expected inputs.
  • The model configuration includes a list of available tools, in this case, the get_current_weather function.
  • The output shows the model's reasoning process, including the selection of the get_weather function and the input provided.

3. Parallel Function Calls

  • The model demonstrates the ability to make parallel function calls, executing multiple functions simultaneously.
  • An example is provided with two functions: get_current_weather and get_population.
  • The prompt "compare the weather and population of New York and San Francisco" triggers the model to execute both functions in parallel.
  • The model successfully retrieves weather and population data for both cities and provides a comparison.
  • The speaker notes that the model has not struggled with parallel function calls, even with more than two functions.

4. Text-to-SQL Assistant

  • The model is used to build a basic text-to-SQL assistant that converts natural language queries into SQL queries.
  • A sample database is created using SQLite, containing employee data with columns for employee number, name, department, and salary.
  • A function called execute_SQL_query executes SQL queries and returns the results.
  • The function is passed as a tool to the model.
  • A system prompt instructs the model to always check the database schema first.
  • The query "what are the average salaries by department" is successfully translated into a SQL query, and the model returns the average salaries for each department.
  • The intermediate SQL query generated by the model is shown.

5. Combining Function Calls: News and Sentiment Analysis

  • The model combines multiple function calls to analyze news articles and determine sentiment.
  • A get_company_news function retrieves news articles for different companies (Apple, Microsoft, Google).
  • A sentiment_analyzer function analyzes the sentiment of a news article based on the presence of positive or negative words.
  • The prompt "what is the recent news about Apple and what's the general sentiment" triggers the model to use both functions.
  • The model retrieves news articles about Apple, analyzes the sentiment of each article, and provides an overall sentiment assessment.

6. Complex Function Calling: Trip Planning

  • The model is used to plan a trip involving multiple steps and function calls.
  • Functions include get_weather_information, search_flights, search_hotels, currency_conversion, and trip_planning.
  • The prompt "I am planning a trip from New York to Paris from April 10 to 13 2025 I need help with finding flights from New York to Paris on the April 10th Checking the weather during my stay Recommending hotels for two people then planning for a daily attorney and here's my total budget" requires the model to use multiple functions sequentially and in parallel.
  • The system prompt instructs the model to act as a travel planner assistant and use the available tools to gather information.
  • The model generates a comprehensive trip plan, including flight options, weather information, hotel recommendations, a daily itinerary, and a budget breakdown.
  • The model performs both sequential and parallel function calls to gather the necessary information.
  • The speaker expresses a desire for the API to provide the internal chain of thought, showing how the model decided on the sequence of function calls.

7. Business Intelligence Dashboard: Combining Text-to-SQL and Unstructured Data

  • The model is used to build a business intelligence dashboard that combines text-to-SQL with unstructured data analysis.
  • The database includes multiple tables: sales, product, regions, and employees.
  • Functions include execute_SQL_query, get_company_database_schema, get_market_data, analyze_sales_trends, and provide_competitive_analysis.
  • The prompt "I need a comprehensive analysis of our electronics product category" requires the model to identify the relevant category, query the database, retrieve market data, and analyze sales trends.
  • The system prompt instructs the model to act as a business intelligence assistant and follow a step-by-step process: query the database, retrieve external market data, and present a well-structured analysis.
  • The model generates a comprehensive analysis of the electronics product category, including competitive analysis, market outlook, and sales trends.
  • The model follows a step-by-step approach, querying the database, retrieving market data, and generating a final response based on the gathered information.
  • The speaker recommends providing step-by-step instructions to the model to guide its behavior, rather than relying on its probabilistic nature to make decisions.

8. Conclusion

  • Gemini 2.5 Pro is a powerful model with strong reasoning and coding capabilities, making it suitable for complex workflows.
  • The model's ability to perform function calling, parallel function calls, and text-to-SQL enables the creation of sophisticated agentic systems.
  • Crafting a well-defined system prompt with step-by-step instructions is crucial for guiding the model's behavior and ensuring accurate results.
  • The speaker offers consulting and advising services for businesses looking to solve similar problems.

AI summaries can miss context or contain errors. Check important details against the original video.

MAKE IT YOURS

Read. Remember. Reuse.

Free tools

Go a little deeper.

Have a question about this video? Load its transcript to open the video chat.