community: chore warn deprecate the tracer (#27159)

- **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
This commit is contained in:
Bharat Ramanathan 2024-11-13 22:03:34 +05:30 committed by GitHub
parent 76e0127539
commit 3e972faf81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@ from typing import (
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
@ -325,6 +326,22 @@ class WandbTracer(BaseTracer):
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.