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)
| 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 | """ |