Skip to content

Commit

Permalink
fix: pin langchain_core to <3 (#1329)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jjmachan authored Sep 18, 2024
1 parent 502b336 commit 21e0643
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ dependencies = [
"datasets",
"tiktoken",
"langchain",
"langchain-core",
"langchain-core<0.3",
"langchain-community",
"langchain_openai",
"openai>1",
Expand Down
6 changes: 3 additions & 3 deletions src/ragas/integrations/opik.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import typing as t

try:
from opik.integrations.langchain import (
from opik.integrations.langchain import ( # type: ignore
OpikTracer as LangchainOpikTracer,
) # type: ignore
)

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

0 comments on commit 21e0643

Please sign in to comment.