FunctionCallingStepwisePlanner Class
A Function Calling Stepwise Planner.
Initialize a new instance of the FunctionCallingStepwisePlanner.
The FunctionCallingStepwisePlanner is a planner based on top of an OpenAI Chat Completion service (whether it be AzureOpenAI or OpenAI), so that we can use tools.
If the options are configured to use callbacks to get the initial plan and the step prompt, the planner will use those provided callbacks to get that information. Otherwise, it will read from the default yaml plan file and the step prompt file.
Constructor
FunctionCallingStepwisePlanner(service_id: str, options: FunctionCallingStepwisePlannerOptions | None = None)
Parameters
| Name | Description |
|---|---|
|
service_id
Required
|
The service id |
|
options
|
<xref:Optional>[<xref:FunctionCallingStepwisePlannerOptions>],<xref: optional>
The options for the function calling stepwise planner. Defaults to None. Default value: None
|
Methods
| invoke |
Execute the function calling stepwise planner. |
invoke
Execute the function calling stepwise planner.
async invoke(kernel: Kernel, question: str, arguments: KernelArguments | None = None, **kwargs: Any) -> FunctionCallingStepwisePlannerResult
Parameters
| Name | Description |
|---|---|
|
kernel
Required
|
The kernel instance |
|
question
Required
|
The input question |
|
arguments
|
(optional) The kernel arguments Default value: None
|
|
kwargs
Required
|
(optional) Additional keyword arguments |
Returns
| Type | Description |
|---|---|
|
The result of the function calling stepwise planner |
Exceptions
| Type | Description |
|---|---|
|
If the input question is empty |
Attributes
generate_plan_yaml
generate_plan_yaml: str
options
options: FunctionCallingStepwisePlannerOptions
service_id
service_id: str
step_prompt
step_prompt: str