File size: 770 Bytes
c8fb072
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from src.sdlc.states.states import State
from src.sdlc.graph.subgraph_builder import SubGraphBuilder
from src.sdlc import logger

class CoderSubgraphNode:
    """
    Node logic implementation.
    """
    def __init__(self,model):
        self.llm = model

    
    def process(self, state: State):
        """
        Processes the input state and generates code files based on design documents.
        """
        sub_graph_builder = SubGraphBuilder(self.llm)
        self.sub_graph = sub_graph_builder.setup_graph()
        
        design = state["design_summary"]
        # Now execute the subgraph
        response = self.sub_graph.invoke({"design_summary": design}) 
        logger.info("INVOKING SUBGRAPH FOR CODE GENERATION...")
        return response