Skip to content

Commit

Permalink
Replace to_json with model_dump (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkuzmik authored Oct 17, 2024
1 parent 0726269 commit 00ce275
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from typing import Any
from typing import Any, Dict
from langchain.load import serializable
from opik import jsonable_encoder


def register() -> None:
def encoder_extension(obj: serializable.Serializable) -> Any:
return obj.to_json()
def encoder_extension(obj: serializable.Serializable) -> Dict[str, Any]:
return obj.model_dump()

jsonable_encoder.register_encoder_extension(
obj_type=serializable.Serializable,
Expand Down

0 comments on commit 00ce275

Please sign in to comment.