Skip to content

Commit 9c0a3da

Browse files
authored
bump langchain to 0.2.x (#464)
1 parent 4d2aac0 commit 9c0a3da

File tree

8 files changed

+41
-48
lines changed

8 files changed

+41
-48
lines changed

libs/e2e-tests/e2e_tests/langchain/test_compatibility_rag.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ def embedding():
173173

174174

175175
@pytest.fixture
176-
def vertex_bison_llm():
176+
def vertex_geminipro_llm():
177177
def llm():
178-
return ChatVertexAI(model_name="chat-bison")
178+
return ChatVertexAI(model_name="gemini-pro")
179179

180180
return {"llm": llm, "nemo_config": None}
181181

@@ -279,29 +279,29 @@ def llm():
279279

280280
@pytest.mark.parametrize(
281281
"test_case",
282-
["trulens"],
282+
["rag_custom_chain", "conversational_rag", "trulens", "nemo_guardrails"],
283283
)
284284
@pytest.mark.parametrize(
285285
"vector_store",
286-
["cassandra"],
286+
["astra_db", "cassandra"],
287287
)
288288
@pytest.mark.parametrize(
289289
"embedding,llm",
290290
[
291-
# ("openai_ada002_embedding", "openai_gpt35turbo_llm"),
292-
# ("openai_3large_embedding", "openai_gpt35turbo_llm_streaming"),
293-
# ("openai_3small_embedding", "openai_gpt4_llm"),
294-
# ("astra_vectorize_openai_small", "openai_gpt4o_llm"),
295-
# ("azure_openai_ada002_embedding", "azure_openai_gpt35turbo_llm"),
296-
("vertex_gecko_embedding", "vertex_bison_llm"),
297-
# ("bedrock_titan_embedding", "bedrock_anthropic_claudev2_llm"),
298-
# ("bedrock_cohere_embedding", "bedrock_mistral_mistral7b_llm"),
299-
# ("bedrock_cohere_embedding", "bedrock_meta_llama2_llm"),
300-
# ("huggingface_hub_minilml6v2_embedding", "huggingface_hub_flant5xxl_llm"),
301-
# (
302-
# "nvidia_aifoundation_embedqa4_embedding",
303-
# "nvidia_aifoundation_mixtral8x7b_llm",
304-
# ),
291+
("openai_ada002_embedding", "openai_gpt35turbo_llm"),
292+
("openai_3large_embedding", "openai_gpt35turbo_llm_streaming"),
293+
("openai_3small_embedding", "openai_gpt4_llm"),
294+
("astra_vectorize_openai_small", "openai_gpt4o_llm"),
295+
("azure_openai_ada002_embedding", "azure_openai_gpt35turbo_llm"),
296+
("vertex_gecko_embedding", "vertex_geminipro_llm"),
297+
("bedrock_titan_embedding", "bedrock_anthropic_claudev2_llm"),
298+
("bedrock_cohere_embedding", "bedrock_mistral_mistral7b_llm"),
299+
("bedrock_cohere_embedding", "bedrock_meta_llama2_llm"),
300+
# # ("huggingface_hub_minilml6v2_embedding", "huggingface_hub_flant5xxl_llm"),
301+
(
302+
"nvidia_aifoundation_embedqa4_embedding",
303+
"nvidia_aifoundation_mixtral8x7b_llm",
304+
),
305305
],
306306
)
307307
def test_rag(test_case, vector_store, embedding, llm, request, record_property):

libs/e2e-tests/e2e_tests/langchain/trulens.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ def _feedback_functions(chain: Runnable, llm: BaseLanguageModel) -> list[Feedbac
2424
context = App.select_context(chain)
2525

2626
f_groundedness = (
27-
Feedback(provider.groundedness_measure_with_cot_reasons, name="Groundedness")
28-
.on(context.collect()) # collect context chunks into a list
27+
Feedback(provider.groundedness_measure_with_cot_reasons, name="groundedness")
28+
.on(context.collect())
2929
.on_output()
3030
)
3131
f_qa_relevance = Feedback(provider.relevance_with_cot_reasons).on_input_output()
3232
f_context_relevance = (
33-
Feedback(provider.qs_relevance_with_cot_reasons)
33+
Feedback(provider.context_relevance_with_cot_reasons)
3434
.on_input()
3535
.on(context.collect())
3636
.aggregate(np.mean)
@@ -77,8 +77,9 @@ def run_trulens_evaluation(vector_store: VectorStore, llm: BaseLanguageModel):
7777

7878
tru_record = recording.get()
7979

80-
# Wait for the feedback results to complete
81-
for feedback_def, feedback_future in tru_record.feedback_and_future_results:
82-
feedback_result = feedback_future.result()
83-
# basic verification that feedback results were computed
80+
for feedback, feedback_result in tru_record.wait_for_feedback_results().items():
81+
print(feedback.name, feedback_result.result)
82+
# github.com/truera/trulens/pull/1193
83+
if feedback.name == "groundedness":
84+
continue
8485
assert feedback_result.result is not None

libs/e2e-tests/pyproject.langchain.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ huggingface-hub = "^0.20.3"
1717
azure-storage-blob = "^12.19.0"
1818
pillow = "^10.2.0"
1919
python-dotenv = "^1.0.1"
20-
trulens-eval = "^0.30.1"
20+
trulens-eval = "^0.31.0"
2121
nemoguardrails = "^0.8.0"
2222
langchainhub = "^0.1.15"
23-
# https://github.com/googleapis/python-aiplatform/issues/3910
24-
google-cloud-aiplatform = "1.53.0"
2523

2624
# From LangChain optional deps, needed by WebBaseLoader
2725
beautifulsoup4 = "^4"

libs/e2e-tests/pyproject.llamaindex.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,9 @@ ruff = "*"
1515
azure-storage-blob = "^12.19.0"
1616
pillow = "^10.2.0"
1717
python-dotenv = "^1.0.1"
18-
trulens-eval = "^0.30.1"
18+
trulens-eval = "^0.31.0"
1919
nemoguardrails = "^0.8.0"
2020
langchainhub = "^0.1.15"
21-
# https://github.com/googleapis/python-aiplatform/issues/3910
22-
google-cloud-aiplatform = "1.53.0"
2321

2422
# From LangChain optional deps, needed by WebBaseLoader
2523
beautifulsoup4 = "^4"

libs/e2e-tests/pyproject.ragstack-ai.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,9 @@ boto3 = "^1.29.6"
1818
azure-storage-blob = "^12.19.0"
1919
pillow = "^10.2.0"
2020
python-dotenv = "^1.0.1"
21-
trulens-eval = "^0.30.1"
21+
trulens-eval = "^0.31.0"
2222
nemoguardrails = "^0.8.0"
2323
langchainhub = "^0.1.15"
24-
# https://github.com/googleapis/python-aiplatform/issues/3910
25-
google-cloud-aiplatform = "1.53.0"
2624

2725
# From LangChain optional deps, needed by WebBaseLoader
2826
beautifulsoup4 = "^4"

libs/e2e-tests/pyproject.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,9 @@ llama-index-llms-huggingface = "^0.1.0"
1717
azure-storage-blob = "^12.19.0"
1818
pillow = "^10.2.0"
1919
python-dotenv = "^1.0.1"
20-
trulens-eval = "^0.30.1"
21-
nemoguardrails = "^0.8.0"
20+
trulens-eval = "^0.31.0"
21+
nemoguardrails = { git = "https://github.com/NVIDIA/NeMo-Guardrails.git", branch = "develop" }
2222
langchainhub = "^0.1.15"
23-
# https://github.com/googleapis/python-aiplatform/issues/3910
24-
google-cloud-aiplatform = "1.53.0"
2523

2624
# From LangChain optional deps, needed by WebBaseLoader
2725
beautifulsoup4 = "^4"

libs/langchain/pyproject.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ unstructured = "0.14.2"
1717
ragstack-ai-colbert = "1.0.5"
1818

1919
# langchain
20-
langchain = "0.1.19"
21-
langchain-core = "0.1.52"
22-
langchain-community = "0.0.38"
20+
langchain = "0.2.3"
21+
langchain-core = "0.2.5"
22+
langchain-community = "0.2.4"
2323
langchain-astradb = "0.3.3"
24-
langchain-openai = "0.1.3"
25-
langchain-google-genai = { version = "0.0.11", optional = true }
26-
langchain-google-vertexai = { version = "1.0.1", optional = true }
27-
langchain-nvidia-ai-endpoints = { version = "0.0.9", optional = true }
24+
langchain-openai = "0.1.8"
25+
langchain-google-genai = { version = "1.0.6", optional = true }
26+
langchain-google-vertexai = { version = "1.0.5", optional = true }
27+
langchain-nvidia-ai-endpoints = { version = "0.1.1", optional = true }
2828

2929
[tool.poetry.extras]
3030
colbert = ["ragstack-ai-colbert"]

libs/llamaindex/pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ llama-index-embeddings-azure-openai = { version = "0.1.7", optional = true }
3232
llama-index-llms-bedrock = { version = "0.1.7", optional = true }
3333
llama-index-embeddings-bedrock = { version = "0.1.4", optional = true }
3434
## google
35-
llama-index-llms-gemini = { version = "0.1.7", optional = true }
36-
llama-index-multi-modal-llms-gemini = { version = "0.1.5", optional = true }
35+
llama-index-llms-gemini = { version = "0.1.10", optional = true }
36+
llama-index-multi-modal-llms-gemini = { version = "0.1.7", optional = true }
3737
llama-index-llms-vertex = { version = "0.1.5", optional = true }
38-
llama-index-embeddings-gemini = { version = "0.1.6", optional = true }
38+
llama-index-embeddings-gemini = { version = "0.1.7", optional = true }
3939
cffi = "^1.16.0"
4040

4141
[tool.poetry.extras]

0 commit comments

Comments
 (0)