Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

test: migrate Ollama tests to langchain_ollama (#4377)

Astro56f35ded0e08
diff --git a/tests/programmatic_access/test_ollama_integration.py b/tests/programmatic_access/test_ollama_integration.py
index a91884b1b3..1df3131fd6 100644
--- a/tests/programmatic_access/test_ollama_integration.py
+++ b/tests/programmatic_access/test_ollama_integration.py
@@ -4,8 +4,7 @@ import pytest
import os
from typing import List
from datetime import datetime
-from langchain_ollama import ChatOllama
-from langchain_community.embeddings import OllamaEmbeddings
+from langchain_ollama import ChatOllama, OllamaEmbeddings
from langchain_community.vectorstores import FAISS
from langchain_core.retrievers import Document
diff --git a/tests/test_programmatic_custom_llm_retriever.py b/tests/test_programmatic_custom_llm_retriever.py
index 13c4ee5952..d176d83311 100644
--- a/tests/test_programmatic_custom_llm_retriever.py
+++ b/tests/test_programmatic_custom_llm_retriever.py
@@ -3,8 +3,7 @@
import pytest
from unittest.mock import patch, MagicMock
import requests
-from langchain_community.llms import Ollama
-from langchain_community.embeddings import OllamaEmbeddings
+from langchain_ollama import OllamaEmbeddings, OllamaLLM
from langchain_community.vectorstores import FAISS
from langchain_core.retrievers import Document
@@ -75,7 +74,7 @@ def sample_documents():
def ollama_llm():
"""Create an Ollama LLM instance."""
# Using gemma3n:e4b as requested
- return Ollama(
+ return OllamaLLM(
model="gemma3n:e4b",
temperature=0.7,
)
@@ -300,7 +299,7 @@ def test_custom_vector_store_with_more_documents():
)
# Create Ollama LLM
- llm = Ollama(model="gemma3n:e4b", temperature=0.3)
+ llm = OllamaLLM(model="gemma3n:e4b", temperature=0.3)
with patch(
"local_deep_research.api.research_functions._init_search_system"
@@ -361,7 +360,7 @@ def test_multiple_retrievers_with_ollama():
ml_retriever = ml_vectorstore.as_retriever()
app_retriever = app_vectorstore.as_retriever()
- ollama_llm = Ollama(model="gemma3n:e4b")
+ ollama_llm = OllamaLLM(model="gemma3n:e4b")
with patch(
"local_deep_research.api.research_functions._init_search_system"
@@ -397,7 +396,7 @@ def test_simple_ollama_factory_pattern():
def create_ollama_llm(model_name="gemma3n:e4b", temperature=0.7, **kwargs):
"""Factory function for creating configured Ollama instances."""
- return Ollama(
+ return OllamaLLM(
model=model_name,
temperature=temperature,
num_predict=kwargs.get("max_tokens", 256),