MCPcopy Create free account
hub / github.com/ScrapeGraphAI/Scrapegraph-ai / handle_directory

Method handle_directory

scrapegraphai/nodes/fetch_node.py:128–143  ·  view source on GitHub ↗

Handles the directory by compressing the source document and updating the state. Parameters: state (dict): The current state of the graph. input_type (str): The type of input being processed. source (str): The source document to be compressed. Retur

(self, state, input_type, source)

Source from the content-addressed store, hash-verified

126 raise ValueError(f"Invalid input type: {input_type}")
127
128 def handle_directory(self, state, input_type, source):
129 """
130 Handles the directory by compressing the source document and updating the state.
131
132 Parameters:
133 state (dict): The current state of the graph.
134 input_type (str): The type of input being processed.
135 source (str): The source document to be compressed.
136
137 Returns:
138 dict: The updated state with the compressed document.
139 """
140
141 compressed_document = [source]
142 state.update({self.output[0]: compressed_document})
143 return state
144
145 def handle_file(self, state, input_type, source):
146 """

Callers

nothing calls this directly

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected