Skip to content

Commit

Permalink
Feat/support langchain 0 3 (#71)
Browse files Browse the repository at this point in the history
* chore: Fix issue
  • Loading branch information
valeriosofi authored Oct 8, 2024
1 parent f67e254 commit e220d15
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion nebuly/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
from .init import init

__all__ = ["init", "new_interaction"]
__version__ = "0.3.32"
__version__ = "0.3.33"
6 changes: 6 additions & 0 deletions nebuly/providers/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,8 +338,14 @@ def _get_rag_source(self) -> str | None:
if self.data.kwargs is None or len(self.data.kwargs) == 0:
raise ValueError("Event has no kwargs.")
if self.data.type is EventType.TOOL:
serialized = self.data.kwargs["serialized"]
if serialized is None and "name" in self.data.kwargs:
return str(self.data.kwargs["name"])
return self.data.kwargs["serialized"]["name"] # type: ignore
if self.data.type is EventType.RETRIEVAL:
serialized = self.data.kwargs["serialized"]
if serialized is None and "name" in self.data.kwargs:
return str(self.data.kwargs["name"])
return self.data.kwargs["serialized"]["id"][-1] # type: ignore

return None
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "nebuly"
version = "0.3.32"
version = "0.3.33"
description = "The SDK for instrumenting applications for tracking AI costs."
authors = ["Nebuly"]
readme = "README.md"
Expand Down

0 comments on commit e220d15

Please sign in to comment.