From 521305f8e9e7ccd4052794958245dc51ec0b2a50 Mon Sep 17 00:00:00 2001 From: Reinier van der Leer Date: Sat, 14 Oct 2023 15:22:04 -0700 Subject: [PATCH] Fix typing of @coroutine decorator --- autogpts/autogpt/autogpt/core/runner/client_lib/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/autogpts/autogpt/autogpt/core/runner/client_lib/utils.py b/autogpts/autogpt/autogpt/core/runner/client_lib/utils.py index 39b5135f..ebb03edb 100644 --- a/autogpts/autogpt/autogpt/core/runner/client_lib/utils.py +++ b/autogpts/autogpt/autogpt/core/runner/client_lib/utils.py @@ -1,7 +1,7 @@ import asyncio import functools from bdb import BdbQuit -from typing import Callable, ParamSpec, TypeVar +from typing import Any, Callable, Coroutine, ParamSpec, TypeVar import click @@ -53,9 +53,9 @@ def handle_exceptions( return wrapped -def coroutine(f): +def coroutine(f: Callable[P, Coroutine[Any, Any, T]]) -> Callable[P, T]: @functools.wraps(f) - def wrapper(*args, **kwargs): + def wrapper(*args: P.args, **kwargs: P.kwargs): return asyncio.run(f(*args, **kwargs)) return wrapper