-
Notifications
You must be signed in to change notification settings - Fork 3.3k
/
process_end_step.py
45 lines (36 loc) · 1.58 KB
/
process_end_step.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# Copyright (c) Microsoft. All rights reserved.
from typing import TYPE_CHECKING, ClassVar
from semantic_kernel.processes.kernel_process.kernel_process_step_info import KernelProcessStepInfo
from semantic_kernel.processes.kernel_process.kernel_process_step_state import KernelProcessStepState
from semantic_kernel.processes.process_step_builder import ProcessStepBuilder
from semantic_kernel.utils.experimental_decorator import experimental_class
if TYPE_CHECKING:
from semantic_kernel.functions import KernelFunctionMetadata
from semantic_kernel.kernel import Kernel
@experimental_class
class EndStep(ProcessStepBuilder):
"""An end step in a process."""
END_STEP_VALUE: ClassVar[str] = "Microsoft.SemanticKernel.Process.EndStep"
END_STEP_NAME: ClassVar[str] = END_STEP_VALUE
END_STEP_ID: ClassVar[str] = END_STEP_VALUE
@staticmethod
def get_instance() -> "EndStep":
"""Get the instance of the end step."""
return EndStep()
def __init__(self):
"""Initialize the end step."""
super().__init__(
name=self.END_STEP_VALUE,
)
def get_function_metadata_map(
self, plugin_type, name: str | None = None, kernel: "Kernel | None" = None
) -> dict[str, "KernelFunctionMetadata"]:
"""Gets the function metadata map."""
return {}
def build_step(self) -> KernelProcessStepInfo:
"""Build the step."""
return KernelProcessStepInfo(
inner_step_type=KernelProcessStepState,
state=KernelProcessStepState(name=self.END_STEP_NAME),
output_edges={},
)