8 Function Calling with Automatic Planning

 

This chapter covers

  • What is an autonomous agent?
  • Dynamic AI orchestration with automatic planning
  • Dry-run disabling auto invocation
  • Parallel calls and concurrent invocation

In the previous chapter, we focused on static AI orchestration with manual planning, where we explicitly instructed Robby, our robot car, to execute specific functions using function calling. Every action is explicitly chosen and sequenced by us, giving Robby little autonomy in deciding how to respond to user requests.

In this chapter, we take the next step: exploring dynamic AI orchestration with automatic planning. Here, instead of hardcoding which functions to call, we allow the large language model (LLM) to select and invoke functions based on the context of the user’s input and the semantic meaning of available tools. This approach gives Robby greater autonomy, enabling it to analyze complex instructions and determine the best sequence of actions on its own, while still operating within the boundaries we define.

You’ll learn how Semantic Kernel supports automatic planning, how to configure function choice behaviors, and how to balance autonomy with control. By the end of this chapter, you’ll be able to build AI autonomous agents where Robby can handle more complex, real-world scenarios-making decisions and executing tasks dynamically, just like a self-driving car navigating unpredictable roads.

8.1 What is an Autonomous Agent?

8.2 Function Choice Behavior with Automatic Planning

8.2.1 Introducing Dynamic AI Orchestration with Automatic Planning

8.2.2 Auto Behavior with Automatic Planning

8.2.3 Required Behavior with Automatic Planning

8.2.4 None Behavior with Automatic Planning

8.2.5 Exercises

8.3 Dry-run with AutoInvoke

8.3.1 Function Auto Invocation Modes

8.3.2 Differences Between autoInvoke = false and None()

8.4 Mastering Advanced Function Choice Behavior

8.4.1 Allowing Parallel Calls

8.4.2 Allowing Concurrent Calls

8.4.3 Allowing Parallel and Concurrent Calls

8.4.4 Disabling Parallel and Concurrent Calls

8.4.5 Exercises

8.4.6 Allowing Strict Schema Adherence

Summary