mirror of
https://github.com/microsoft/autogen.git
synced 2026-01-03 18:51:28 +00:00
Fix incorrect type cast (#4620)
Co-authored-by: Hussein Mozannar <hmozannar@microsoft.com>
This commit is contained in:
parent
d96997232f
commit
51d4a10774
@ -18,7 +18,7 @@ InputFuncType = Union[SyncInputFunc, AsyncInputFunc]
|
||||
# TODO: ainput doesn't seem to play nicely with jupyter.
|
||||
# No input window appears in this case.
|
||||
async def cancellable_input(prompt: str, cancellation_token: Optional[CancellationToken]) -> str:
|
||||
task = asyncio.Task[str](asyncio.create_task(ainput(prompt))) # type: ignore
|
||||
task: asyncio.Task[str] = asyncio.create_task(ainput(prompt)) # type: ignore
|
||||
if cancellation_token is not None:
|
||||
cancellation_token.link_future(task)
|
||||
return await task
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user