Merged
Conversation
a06da7b to
30a6f7c
Compare
08082f1 to
04cfe8e
Compare
12 tasks
04cfe8e to
388026e
Compare
388026e to
00153f8
Compare
00153f8 to
fb5f15c
Compare
fb5f15c to
bec1719
Compare
Remove langchain and associated dependencies to simplify the codebase and reduce exposure to third-party dependency issues. Removed dependencies: - langchain~=0.3.10 - langchain-core~=0.3.81 - langchain-ollama~=0.3.5 - langchain-text-splitters~=0.3.11 Removed files: - ansible_ai_connect/ai/api/model_pipelines/langchain/ (entire directory) - configuration.py - pipelines.py - tests/test_pipeline.py Refactored ollama module to be fully self-contained: Configuration (ollama/configuration.py): - Created OllamaConfiguration extending BaseConfig directly - Created OllamaBasePipelineConfiguration - Removed dependency on langchain configuration classes Pipelines (ollama/pipelines.py): - Created custom OllamaClient for direct Ollama API communication - Moved all utility functions from langchain module: * message_to_string() * create_role_outline() * unwrap_role_answer() * unwrap_message_with_yaml_answer() * unwrap_playbook_answer() * unwrap_task_answer() - Implemented all pipeline classes without langchain: * OllamaMetaData * OllamaCompletionsPipeline * OllamaPlaybookGenerationPipeline * OllamaRoleGenerationPipeline * OllamaRoleExplanationPipeline (returns "nop" health check - not implemented) * OllamaPlaybookExplanationPipeline Tests (ollama/tests/test_pipelines.py): - Migrated relevant tests from deleted langchain/tests/test_pipeline.py - Added comprehensive test coverage for: * Unwrap functions (task, playbook, role, message parsing) * Completions pipeline with mocked requests.post * Playbook generation pipeline (with and without outline, custom prompt) * Role generation pipeline (with and without outline) * Playbook explanation pipeline (with custom prompt) - All tests updated to mock requests.post instead of langchain's FakeListLLM - Prevents AttributeError from patching non-existent symbols Updated configuration: - pyproject.toml: Removed langchain dependencies and pyright path - requirements.txt: Regenerated without langchain (15 fewer packages) - uv.lock: Regenerated without langchain dependencies - .github/workflows/pyright.yml: Removed langchain from CI dependencies All functionality preserved. Type checking passes with pyright. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
bec1719 to
83f5238
Compare
de1987
approved these changes
Feb 12, 2026
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Remove langchain and associated dependencies to simplify the codebase
and reduce exposure to third-party dependency issues.
Removed dependencies:
Removed files:
Refactored ollama module to be fully self-contained:
Configuration (ollama/configuration.py):
Pipelines (ollama/pipelines.py):
Updated configuration:
All functionality preserved. Type checking passes with pyright.
Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com
Note
Medium Risk
Changes core Ollama inference codepaths and parsing behavior (now direct HTTP + custom prompt formatting), so runtime regressions are possible despite test coverage and dependency reduction.
Overview
Removes the
langchain-based model pipeline implementation and drops thelangchain*dependency chain from the project (CI install,pyproject.toml,requirements.txt,uv.lock, andpyrightconfig).Refactors the
ollamamodel pipeline to no longer depend onlangchainby introducing a smallrequests-basedOllamaClient, re-implementing prompt formatting and response-unwrapping helpers locally, and updating tests to mock HTTP calls instead oflangchain_ollamaobjects.OllamaRoleExplanationPipelineis now an explicitFeatureNotAvailablestub rather than inheriting from thenoppipeline.Written by Cursor Bugbot for commit 83f5238. This will update automatically on new commits. Configure here.