Skip to content

Commit be2bd89

Browse files
CopilotTomeHirata
andcommitted
Fix Module overload to use Any instead of unbound TypeVar T
Co-authored-by: TomeHirata <[email protected]>
1 parent 4b759b3 commit be2bd89

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dspy/utils/asyncify.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import TYPE_CHECKING, Awaitable, Callable, ParamSpec, TypeVar, Union, overload
1+
from typing import TYPE_CHECKING, Any, Awaitable, Callable, ParamSpec, TypeVar, Union, overload
22

33
import asyncer
44
from anyio import CapacityLimiter
@@ -35,10 +35,10 @@ def asyncify(program: Callable[P, T]) -> Callable[P, Awaitable[T]]: ...
3535

3636

3737
@overload
38-
def asyncify(program: "Module") -> Callable[..., Awaitable[T]]: ...
38+
def asyncify(program: "Module") -> Callable[..., Awaitable[Any]]: ...
3939

4040

41-
def asyncify(program: Union[Callable[P, T], "Module"]) -> Callable[P, Awaitable[T]] | Callable[..., Awaitable[T]]:
41+
def asyncify(program: Union[Callable[P, T], "Module"]) -> Callable[P, Awaitable[T]] | Callable[..., Awaitable[Any]]:
4242
"""
4343
Wraps a DSPy program or callable so that it can be called asynchronously. This is useful for running a
4444
program in parallel with another task (e.g., another DSPy program).

0 commit comments

Comments
 (0)