Skip to content
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

Fix tracing hierarchy for imperative api #3036

Merged
merged 9 commits into from
Jan 15, 2025

Conversation

nfcampos
Copy link
Contributor

No description provided.

@hinthornw
Copy link
Contributor

Pretty simple fix. Wish I could forget the Callbacks constant though :P

@@ -148,9 +150,12 @@ def call(
input: Any,
*,
retry: Optional[RetryPolicy] = None,
callbacks: Optional[Callbacks] = None,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Callbacks is already wrapped in an Optional in langchain_core

task = self.executor.submit(next_tick, fn, *args, **kwargs)
task = cast(
concurrent.futures.Future[T],
self.executor.submit(next_tick, ctx.run, fn, *args, **kwargs), # type: ignore[arg-type]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: next_tick is a bit confusing on the sync side -- sleep(0) isn't guaranteed to context switch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the closest equivalent. And yes it does context switch https://stackoverflow.com/a/7273727

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also not something being changed in this PR?

Base automatically changed from nc/14jan/rm-send-v2 to main January 15, 2025 16:29
@nfcampos nfcampos enabled auto-merge January 15, 2025 17:03
@nfcampos nfcampos merged commit d12830e into main Jan 15, 2025
58 checks passed
@nfcampos nfcampos deleted the nc/14jan/fix-tracing-hierarchy-imperative branch January 15, 2025 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants