o
    xi                     @   s~   d Z ddlmZ ddlZddlmZ ddlmZ ej	j
dddZeejed	k r/ed
ddlmZ G dd deZdS )a  This module contains an integration with the LangChain library.

Specifically, it exposes a `WandbTracer` class that can be used to stream
LangChain activity to W&B. The intended usage pattern is to call
`tracer = WandbTracer()` at the top of the script/notebook, and call
`tracer.finish()` at the end of the script/notebook.
 This will stream all LangChain activity to W&B.

Technical Note:
LangChain is in very rapid development - meaning their APIs and schemas are actively changing.
As a matter of precaution, any call to LangChain apis, or use of their returned data is wrapped
in a try/except block. This is to ensure that if a breaking change is introduced, the W&B
integration will not break user code. The one exception to the rule is at import time. If
LangChain is not installed, or the symbols are not in the same place, the appropriate error
will be raised when importing this module.
    )versionN)
Deprecated)warn_and_record_deprecation	langchainzTo use the LangChain WandbTracer you need to have the `langchain` python package installed. Please install it with `pip install langchain`.)namerequiredz0.0.188zThe Weights & Biases Langchain integration does not support versions 0.0.187 and lower. To ensure proper functionality, please use version 0.0.188 or higher.)WandbTracerc                       s   e Zd Z fddZ  ZS )r   c                    s(   t  j|i | ttdddd d S )NT)langchain_traceraZ  This feature is deprecated and has been moved to `langchain`. Enable tracing by setting LANGCHAIN_WANDB_TRACING=true in your environment. See the documentation at https://python.langchain.com/docs/ecosystem/integrations/agent_with_wandb_tracing for guidance. Replace your current import with `from langchain.callbacks.tracers import WandbTracer`.)featuremessage)super__init__r   r   )selfargskwargs	__class__ \/home/ubuntu/.local/lib/python3.10/site-packages/wandb/integration/langchain/wandb_tracer.pyr   )   s
   
zWandbTracer.__init__)__name__
__module____qualname__r   __classcell__r   r   r   r   r   (   s    r   )__doc__	packagingr   
wandb.utilwandbwandb.proto.wandb_telemetry_pb2r   wandb.sdk.lib.deprecationr   util
get_moduler   parse__version__
ValueErrorlangchain.callbacks.tracersr   r   r   r   r   <module>   s    