Skip to content

Commit

Permalink
community: chore warn deprecate the tracer (#27159)
Browse files Browse the repository at this point in the history
- **Description:**: This PR deprecates the wandb tracer in favor of the
new
[WeaveTracer](https://weave-docs.wandb.ai/guides/integrations/langchain#using-weavetracer)
in W&B
- **Dependencies:** No dependencies, just a deprecation warning.
- **Twitter handle:** @parambharat


@baskaryan
  • Loading branch information
parambharat authored Nov 13, 2024
1 parent 76e0127 commit 3e972fa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions libs/community/langchain_community/callbacks/tracers/wandb.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
Union,
)

from langchain_core._api import warn_deprecated
from langchain_core.output_parsers.pydantic import PydanticBaseModel
from langchain_core.tracers.base import BaseTracer
from langchain_core.tracers.schemas import Run
Expand Down Expand Up @@ -325,6 +326,22 @@ def __init__(
self._run_args = run_args
self._ensure_run(should_print_url=(wandb.run is None))
self._io_serializer = io_serializer
warn_deprecated(
"0.3.8",
pending=False,
message=(
"Please use the `WeaveTracer` from the `weave` package instead of this."
"The `WeaveTracer` is a more flexible and powerful tool for logging "
"and tracing your LangChain callables."
"Find more information at https://weave-docs.wandb.ai/guides/integrations/langchain"
),
alternative=(
"Please instantiate the WeaveTracer from "
"`weave.integrations.langchain import WeaveTracer` ."
"For autologging simply use `weave.init()` and log all traces "
"from your LangChain callables."
),
)

def finish(self) -> None:
"""Waits for all asynchronous processes to finish and data to upload.
Expand Down

0 comments on commit 3e972fa

Please sign in to comment.