File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -88,19 +88,22 @@ def execute(self, state: dict) -> dict:
88
88
# Initialize the output parser
89
89
if self .node_config .get ("schema" , None ) is not None :
90
90
output_parser = JsonOutputParser (pydantic_object = self .node_config ["schema" ])
91
+ if isinstance (self .llm_model , ChatOpenAI ):
92
+ self .llm_model = self .llm_model .with_structured_output (self .node_config ["schema" ])
93
+
91
94
else :
92
95
output_parser = JsonOutputParser ()
93
96
94
97
format_instructions = output_parser .get_format_instructions ()
95
98
99
+ template_no_chunks_prompt = template_no_chunks
100
+ template_chunks_prompt = template_chunks
101
+ template_merge_prompt = template_merge
102
+
96
103
if isinstance (self .llm_model , ChatOpenAI ) and not self .script_creator or self .force and not self .script_creator or self .is_md_scraper :
97
104
template_no_chunks_prompt = template_no_chunks_md
98
105
template_chunks_prompt = template_chunks_md
99
106
template_merge_prompt = template_merge_md
100
- else :
101
- template_no_chunks_prompt = template_no_chunks
102
- template_chunks_prompt = template_chunks
103
- template_merge_prompt = template_merge
104
107
105
108
if self .additional_info is not None :
106
109
template_no_chunks_prompt = self .additional_info + template_no_chunks_prompt
You can’t perform that action at this time.
0 commit comments