Skip to content

Commit 21e0643

Browse files
authored
fix: pin langchain_core to <3 (#1329)
The new langchain v0.3 will break the current usage of metrics. the plan for actions is as follows 1. for ragas<0.2 we will pin langchain_core to <0.3 2. for ragas>0.2 we will directly depend on pydantic>=2 fixes: #1328
1 parent 502b336 commit 21e0643

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ dependencies = [
55
"datasets",
66
"tiktoken",
77
"langchain",
8-
"langchain-core",
8+
"langchain-core<0.3",
99
"langchain-community",
1010
"langchain_openai",
1111
"openai>1",

src/ragas/integrations/opik.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import typing as t
22

33
try:
4-
from opik.integrations.langchain import (
4+
from opik.integrations.langchain import ( # type: ignore
55
OpikTracer as LangchainOpikTracer,
6-
) # type: ignore
6+
)
77

88
from ragas.evaluation import RAGAS_EVALUATION_CHAIN_NAME
99
except ImportError:
@@ -32,7 +32,7 @@ class OpikTracer(LangchainOpikTracer):
3232
def _process_start_trace(self, run: "Run"):
3333
if (run.parent_run_id is None) and (run.name == RAGAS_EVALUATION_CHAIN_NAME):
3434
# Store the evaluation run id so we can flag the child traces and log them independently
35-
self._evaluation_run_id = run.id
35+
self._evaluation_run_id = str(run.id)
3636
else:
3737
if run.parent_run_id == self._evaluation_run_id:
3838
run.parent_run_id = None

0 commit comments

Comments
 (0)