@@ -62,8 +62,10 @@ def __init__(
62
62
{} if node_config is None else node_config .get ("llm_model" , {})
63
63
)
64
64
self .force = (
65
- {} if node_config is None else node_config .get ("force" , {} )
65
+ {} if node_config is None else node_config .get ("force" , False )
66
66
)
67
+ self .script_creator = node_config .get ("script_creator" , False )
68
+
67
69
68
70
def execute (self , state ):
69
71
"""
@@ -146,7 +148,7 @@ def execute(self, state):
146
148
147
149
parsed_content = source
148
150
149
- if isinstance (self .llm_model , OpenAI ) and self .input == "-----" or self .force :
151
+ if isinstance (self .llm_model , OpenAI ) and not self .script_creator or self .force and not self . script_creator :
150
152
parsed_content = convert_to_md (source )
151
153
152
154
compressed_document = [
@@ -162,7 +164,7 @@ def execute(self, state):
162
164
163
165
parsed_content = source
164
166
165
- if isinstance (self .llm_model , OpenAI ) and self .input == "-----" or self .force :
167
+ if isinstance (self .llm_model , OpenAI ) and not self .script_creator or self .force and not self . script_creator :
166
168
parsed_content = convert_to_md (source )
167
169
compressed_document = [Document (page_content = parsed_content )]
168
170
else :
@@ -184,7 +186,7 @@ def execute(self, state):
184
186
raise ValueError ("No HTML body content found in the document fetched by ChromiumLoader." )
185
187
parsed_content = document [0 ].page_content
186
188
187
- if isinstance (self .llm_model , OpenAI ) and self .input == "-----" or self .force :
189
+ if isinstance (self .llm_model , OpenAI ) and not self .script_creator or self .force and not self . script_creator :
188
190
parsed_content = convert_to_md (document [0 ].page_content )
189
191
190
192
compressed_document = [
0 commit comments