Skip to content

Commit 25066b2

Browse files
committed
refactor: remove LangChain wrappers for Ollama
1 parent 2c5f934 commit 25066b2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

scrapegraphai/nodes/generate_answer_omni_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from langchain_core.output_parsers import JsonOutputParser
1111
from langchain_core.runnables import RunnableParallel
1212
from tqdm import tqdm
13-
from ..models import Ollama
13+
from langchain_community.chat_models import ChatOllama
1414
# Imports from the library
1515
from .base_node import BaseNode
1616
from ..helpers.generate_answer_node_omni_prompts import template_no_chunk_omni, template_chunks_omni, template_merge_omni
@@ -44,7 +44,7 @@ def __init__(
4444
super().__init__(node_name, "node", input, output, 3, node_config)
4545

4646
self.llm_model = node_config["llm_model"]
47-
if isinstance(node_config["llm_model"], Ollama):
47+
if isinstance(node_config["llm_model"], ChatOllama):
4848
self.llm_model.format="json"
4949

5050
self.verbose = (

scrapegraphai/nodes/generate_answer_pdf_node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from langchain_core.output_parsers import JsonOutputParser
1111
from langchain_core.runnables import RunnableParallel
1212
from tqdm import tqdm
13-
from ..models import Ollama
13+
from langchain_community.chat_models import ChatOllama
1414
from ..utils.logging import get_logger
1515

1616
# Imports from the library
@@ -59,7 +59,7 @@ def __init__(
5959
super().__init__(node_name, "node", input, output, 2, node_config)
6060

6161
self.llm_model = node_config["llm_model"]
62-
if isinstance(node_config["llm_model"], Ollama):
62+
if isinstance(node_config["llm_model"], ChatOllama):
6363
self.llm_model.format="json"
6464

6565
self.verbose = (

0 commit comments

Comments
 (0)