-
Notifications
You must be signed in to change notification settings - Fork 15.4k
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
Avoid copying runs #26689
Avoid copying runs #26689
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
f99d417
to
ee5f1c1
Compare
def _start_trace(self, run: Run) -> None: | ||
super()._start_trace(run) | ||
if run._client is None: | ||
run._client = self.client |
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.
This is so that if you were defining the client solely via a LangChainTracer we will hand off that client to the nested run tree
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.
any situations when one might create two tracers with different clients and pass them as callbacks?
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.
Hmm.
This would still work in the case where it's all langchain code then.
This would not work for implicit propagation handoff to traceable (since traceable doesn't let you set multiple parents at a given time)
In either case I think that would be undesirable / haven't heard of anyone doing that before
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.
I assume no easy way to catch that as an issue to raise an error?
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.
hmm I kinda would prefer if we still traced something / didn't raise an error that could potentially interrupt their execution flow? It's kinda hard to catch correctly
global _CLIENT | ||
if _CLIENT is not None and _CLIENT.tracing_queue is not None: | ||
_CLIENT.tracing_queue.join() | ||
if rt._CLIENT is not None and rt._CLIENT.tracing_queue is not None: |
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.
oh nice
def _start_trace(self, run: Run) -> None: | ||
super()._start_trace(run) | ||
if run._client is None: | ||
run._client = self.client |
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.
any situations when one might create two tracers with different clients and pass them as callbacks?
Also, re-unify run trees. Use a single shared client.
Also, re-unify run trees. Use a single shared client. Etc.