I'm getting the following error
InvalidArgument: 400 For controlled generation of only function calls (forced function calling), please set 'tool_config.function_calling_config.mode' field to ANY instead of populating 'response_mime_type' and 'response_schema' fields. For more details, see: https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#tool-config
When the agents have a response_format and there is a shared_context declared.
I took the example in https://docs.ag2.ai/docs/user-guide/basic-concepts/orchestration/swarm
And declared a response format for the lesson_planner agent.
class LessonPlan(BaseModel):
title: Annotated[str, "Lesson plan title"]
learning_objective: Annotated[str, "Key learning objectives"]
script: Annotated[str, "How to introduce the topic to the kids"]
and
lesson_planner_llm_config = llm_config.copy()
lesson_planner_llm_config["response_format"] = LessonPlan
planner_message = """You are a classroom lesson planner.
Given a topic, write a lesson plan for a fourth grade class.
If you are given revision feedback, update your lesson plan and record it.
"""
# 3. Our agents now have tools to use (functions above)
lesson_planner = ConversableAgent(
name="planner_agent", llm_config=lesson_planner_llm_config, system_message=planner_message, functions=[record_plan]
)
AG2