globe-pointerđŸ“‹Standard Operation Procedure (SOP) System

Brief Introduction

A Standard Operating Procedure (SOP) is a reasoning graph that consists of a set of step-by-step instructions outlining how to execute a specific task or process. Overall, the SOP System enables users to communicate with different agents simultaneously or create virtual cases, allowing agents to interact with each other.

SOPConfig

The SOPConfig class is the configuration class for the SOP system. It initializes the required fields of the SOP config, such as nodes, edges, root, and end. The SOPConfig class also generates the SOP config automatically based on the query and task description.

class SOPConfig(Config):
    required_fields = ["nodes", "edges", "root"]

    def __init__(self, config_path_or_dict: Union[str, dict] = None) -> None:
        super().__init__(config_path_or_dict)
        self._validate_config()

        self.nodes: Dict[str, dict] = self.config_dict["nodes"]
        self.edges: Dict[str, List[str]] = self.config_dict["edges"]
        self.root: str = self.config_dict["root"]
        self.end: str = self.config_dict.get("end", "end_node")
        self.global_kb: Dict[str, Any[list, str]] = self.config_dict.get("kb", None)

Generate config

The generate_config method generates the SOP config automatically based on the query and task description. The SOP config is generated by the OpenAI LLM model.

Check config

The check_config method checks the validation of SOP config. It checks whether the required fields are in the config, whether the nodes in the edges are in the nodes, and whether the root and end nodes are in the nodes.

Next

The Next method determines the next state and the role that needs action based on the current situation. Detailed remarks are added to the codes.

Last updated