|
4 | 4 |
|
5 | 5 | import json
|
6 | 6 | from typing import List, Optional
|
7 |
| -from langchain_openai import ChatOpenAI |
| 7 | +from langchain_openai import ChatOpenAI, AzureChatOpenAI |
8 | 8 | import pandas as pd
|
9 | 9 | import requests
|
10 | 10 | from langchain_community.document_loaders import PyPDFLoader
|
@@ -221,7 +221,7 @@ def handle_local_source(self, state, source):
|
221 | 221 |
|
222 | 222 | parsed_content = source
|
223 | 223 |
|
224 |
| - if isinstance(self.llm_model, ChatOpenAI) and not self.script_creator or self.force and not self.script_creator: |
| 224 | + if (isinstance(self.llm_model, ChatOpenAI) or isinstance(self.llm_model, AzureChatOpenAI)) and not self.script_creator or self.force and not self.script_creator: |
225 | 225 | parsed_content = convert_to_md(source)
|
226 | 226 | else:
|
227 | 227 | parsed_content = source
|
@@ -258,7 +258,7 @@ def handle_web_source(self, state, source):
|
258 | 258 | if not self.cut:
|
259 | 259 | parsed_content = cleanup_html(response, source)
|
260 | 260 |
|
261 |
| - if (isinstance(self.llm_model, ChatOpenAI) |
| 261 | + if ((isinstance(self.llm_model, ChatOpenAI) or isinstance(self.llm_model, AzureChatOpenAI)) |
262 | 262 | and not self.script_creator) or (self.force and not self.script_creator):
|
263 | 263 | parsed_content = convert_to_md(source, parsed_content)
|
264 | 264 |
|
@@ -287,7 +287,7 @@ def handle_web_source(self, state, source):
|
287 | 287 | raise ValueError("No HTML body content found in the document fetched by ChromiumLoader.")
|
288 | 288 | parsed_content = document[0].page_content
|
289 | 289 |
|
290 |
| - if isinstance(self.llm_model, ChatOpenAI) and not self.script_creator or self.force and not self.script_creator and not self.openai_md_enabled: |
| 290 | + if (isinstance(self.llm_model, ChatOpenAI) or isinstance(self.llm_model, AzureChatOpenAI)) and not self.script_creator or self.force and not self.script_creator and not self.openai_md_enabled: |
291 | 291 | parsed_content = convert_to_md(document[0].page_content, parsed_content)
|
292 | 292 |
|
293 | 293 | compressed_document = [
|
|
0 commit comments