-
Notifications
You must be signed in to change notification settings - Fork 13.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
core[patch]: remove requests #19891
core[patch]: remove requests #19891
Changes from 11 commits
178ac7b
a08ebbe
200464c
d0f93dc
3dfade7
e10519c
5b0d983
a148408
c90c53d
9343fbb
116e428
621c83c
efb042b
e15d035
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,7 @@ | |
from langsmith import utils as ls_utils | ||
from langsmith.run_helpers import get_run_tree_context | ||
|
||
from langchain_core._api import deprecated | ||
from langchain_core.tracers.langchain import LangChainTracer | ||
from langchain_core.tracers.langchain_v1 import LangChainTracerV1 | ||
from langchain_core.tracers.run_collector import RunCollectorCallbackHandler | ||
from langchain_core.tracers.schemas import TracerSessionV1 | ||
from langchain_core.utils.env import env_var_is_set | ||
|
@@ -31,21 +29,14 @@ | |
from langchain_core.callbacks.base import BaseCallbackHandler, Callbacks | ||
from langchain_core.callbacks.manager import AsyncCallbackManager, CallbackManager | ||
|
||
# Deprecated as of 0.1.0, will be removed in 0.2.0. | ||
tracing_callback_var: ContextVar[Optional[LangChainTracerV1]] = ContextVar( # noqa: E501 | ||
"tracing_callback", default=None | ||
) | ||
Comment on lines
-35
to
-37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. dummy var There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Adding |
||
|
||
tracing_v2_callback_var: ContextVar[Optional[LangChainTracer]] = ContextVar( # noqa: E501 | ||
tracing_v2_callback_var: ContextVar[Optional[LangChainTracer]] = ContextVar( | ||
"tracing_callback_v2", default=None | ||
) | ||
run_collector_var: ContextVar[Optional[RunCollectorCallbackHandler]] = ContextVar( # noqa: E501 | ||
) # noqa: E501 | ||
run_collector_var: ContextVar[Optional[RunCollectorCallbackHandler]] = ContextVar( | ||
"run_collector", default=None | ||
) | ||
) # noqa: E501 | ||
|
||
|
||
@contextmanager | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is this breaking? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The whole thing is breaking, but agreed not having Will add back There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
@deprecated("0.1.0", alternative="tracing_v2_enabled", removal="0.2.0") | ||
def tracing_enabled( | ||
session_name: str = "default", | ||
) -> Generator[TracerSessionV1, None, None]: | ||
|
@@ -62,13 +53,9 @@ def tracing_enabled( | |
>>> with tracing_enabled() as session: | ||
... # Use the LangChainTracer session | ||
""" | ||
cb = LangChainTracerV1() | ||
session = cast(TracerSessionV1, cb.load_session(session_name)) | ||
try: | ||
tracing_callback_var.set(cb) | ||
yield session | ||
finally: | ||
tracing_callback_var.set(None) | ||
raise RuntimeError( | ||
"tracing_enabled is no longer supported. Please use tracing_enabled_v2 instead." | ||
) | ||
|
||
|
||
@contextmanager | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we leave dummy vars in they're imported anywhere
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are both inside the
_configure
function so I don't think necessary to stub them?