-
Notifications
You must be signed in to change notification settings - Fork 588
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
Adding RAG tracing & eval cookbook using Parea #390
Conversation
|
||
def _run_worker_in_context(): | ||
self._thread_worker_func() | ||
self.worker = threading.Thread(target=contextvars.copy_context().run, args=(_run_worker_in_context, )) |
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.
Could you tell me why this is required?
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 required to make tracing of the pipeline possible with Parea AI. The tracing mechanism relies on contextvars
to create a hierarchy of function/LLM calls. By creating a new Thread
, this context is otherwise lost.
No description provided.