-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
Hello,
I have a dependency that uses a query from the client:
def select_model(request: Request = TaskiqDepends(), model: str = Query()):
return model
@broker.task
async def foo(
model: str = TaskiqDepends(select_model)
) -> str:
pdb.set_trace()
return model
@router.post("/bar")
async def bar():
print("SENDING")
task = await foo.kiq()
print("SENT")
result = await task.wait_result()
print("RESULT GOT")
return {"hello": result.return_value}
I also have the following test:
@pytest.mark.asyncio
async def test_bar(client: AsyncClient) -> None:
response = await client.post("/api/v1/translate/bar", params={"model": "gpt5000"})
assert response.status_code == 200
I set a breakpoint in foo
, which shows that the value for model
has changed:
(Pdb) model
Query(PydanticUndefined)
(Pdb)
is this intended behavior?
Metadata
Metadata
Assignees
Labels
No labels