Skip to content

Commit 1acd3fb

Browse files
committed
[WIP] Thin dependencies significantly
* Remove lint dependencies from dev target, as linting cannot be done within the app. Too many dependency conflicts (anthropic causes pydoclint to crash, mypy typing bloats image size ~200 MB, etc). * Vendor the tiny bits of langchain_community we need to drop that. Still to-do: * Pull in lint deps for linting runs (these will fail in GHA right now) * Finish PyPDF vendoring (two more classes need to be pulled in) * Test everything fully and completely Implements: AP-470
1 parent 6dd2e5e commit 1acd3fb

File tree

6 files changed

+1267
-6
lines changed

6 files changed

+1267
-6
lines changed

pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,13 @@ build-backend = "setuptools.build_meta"
66
name = "willa"
77
version = "0.0.1"
88
dependencies = [
9-
"anthropic == 0.67.0", # for pydoclint incompatibility
109
"asyncpg",
1110
"awscli-local",
1211
"boto3",
1312
"chainlit ~= 2.7.1",
1413
"lancedb",
15-
"langchain",
1614
"langchain_aws",
17-
"langchain_community",
15+
"langchain_core",
1816
"langchain_ollama",
1917
"langfuse",
2018
"langgraph",
@@ -51,7 +49,7 @@ debug = [
5149
"debugpy",
5250
]
5351
dev = [
54-
"willa[test,lint,debug]"
52+
"willa[test,debug]"
5553
]
5654

5755
[project.scripts]

willa/config/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,19 @@
99
from dotenv import dotenv_values
1010

1111
from langchain_aws import BedrockEmbeddings, ChatBedrockConverse
12-
from langchain_community.vectorstores import LanceDB
1312
from langchain_core.embeddings import Embeddings
1413
from langchain_core.language_models import BaseChatModel
1514
from langchain_core.prompts import ChatPromptTemplate, PromptTemplate
1615
from langchain_ollama import ChatOllama, OllamaEmbeddings
1716
from langfuse import Langfuse
1817
from langfuse.api.resources.commons.errors.not_found_error import NotFoundError
18+
<<<<<<< Updated upstream
1919
from langfuse.model import ChatPromptClient
20+
=======
21+
22+
>>>>>>> Stashed changes
2023
from willa.errors.config import ImproperConfigurationError
24+
from willa.lcvendor.lancedb import LanceDB
2125

2226
# Prompt if langfuse defined prompt can't be set
2327
FALLBACK_PROMPT = """You are a reference librarian who helps researchers answer

willa/etl/doc_proc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
from typing import Any, Optional, Union
1313
from unittest.mock import MagicMock
1414

15-
from langchain_community.document_loaders import PyPDFLoader, PyPDFDirectoryLoader
1615
from langchain.text_splitter import RecursiveCharacterTextSplitter
1716
from langchain_core.documents import Document
1817
from langchain_core.vectorstores.base import VectorStore
1918
from opentelemetry.util._decorator import _AgnosticContextManager
2019
from pymarc.record import Record
2120

2221
from willa.config import CONFIG, get_langfuse_client
22+
from willa.lcvendor.pypdf import PyPDFLoader, PyPDFDirectoryLoader
2323
from willa.tind.format_validate_pymarc import pymarc_to_metadata
2424

2525

willa/lcvendor/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
"""
2+
Vendored code from Langchain Community to reduce dependency bloat.
3+
"""

0 commit comments

Comments
 (0)