Open jreed-Aces opened 2 weeks ago
@jreed-Aces have you found a workaround for this? I'm having the same issue right now and you just happened to create this 2 days ago 🙂
@brbarnett We downgraded to Python 3.10, which doesn't have the optional context
parameter. It fixes the issue, but it's far from ideal.
Locally the code fix I posted above works, but that doesn't help when deploying to Azure.
I have the same issue with py 3.11... Fixed for the moment with py 3.10 version
ran into the same issue with python 3.11 when working on http stream mode on azure function app
run into the same issue using langchain Runnable method ainvoke. This worked for me but don't know why:
loop = asyncio.get_running_loop() loop.set_task_factory(None)
Expected Behavior
Python 3.11 allows for a named
context
parameter to be passed in when constructing a task (https://github.com/python/cpython/blob/3.11/Lib/asyncio/tasks.py#L106). However, the task factory that creates aContextEnabledTask
inside ofdispatcher.py
doesn't allow for that parameter. When a task is added that attempts to utilize the parameter, an error is raised instead:Actual Behavior
The task_factory lambda and the ContextEnabledTask should be able to accept the optional, named parameter of
context
Steps to Reproduce
Using the existing task_factory, attempt to add a new task along with the named
context
parameter.Relevant code being tried