mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-22 15:42:25 +02:00
An async function of the form `def foo(P) -> T` has type `Callable[[P], Awaitable[T]]`. The old type annotations then converted the function into a `Callable[[P], SyncAsyncFuture[Awaitable[T]]]` which is incorrect. The change introduced in this commit updates the type annotations to ensure the `Awaitable[T]` is correctly unwrapped. I've tested it locally and confirmed it work on: ```python @task def sync_fn(a: int) -> int: ... @task def async_fn(a: int) -> int: ... ``` Let me know if you want me to add tests, just let me know how you test type annotations.