mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-22 14:49:29 +00:00
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:
parent
76e0127539
commit
3e972faf81
@ -16,6 +16,7 @@ from typing import (
|
|||||||
Union,
|
Union,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
from langchain_core._api import warn_deprecated
|
||||||
from langchain_core.output_parsers.pydantic import PydanticBaseModel
|
from langchain_core.output_parsers.pydantic import PydanticBaseModel
|
||||||
from langchain_core.tracers.base import BaseTracer
|
from langchain_core.tracers.base import BaseTracer
|
||||||
from langchain_core.tracers.schemas import Run
|
from langchain_core.tracers.schemas import Run
|
||||||
@ -325,6 +326,22 @@ class WandbTracer(BaseTracer):
|
|||||||
self._run_args = run_args
|
self._run_args = run_args
|
||||||
self._ensure_run(should_print_url=(wandb.run is None))
|
self._ensure_run(should_print_url=(wandb.run is None))
|
||||||
self._io_serializer = io_serializer
|
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:
|
def finish(self) -> None:
|
||||||
"""Waits for all asynchronous processes to finish and data to upload.
|
"""Waits for all asynchronous processes to finish and data to upload.
|
||||||
|
Loading…
Reference in New Issue
Block a user