Skip to content

Commit

Permalink
🔧 fix decorator typing
Browse files Browse the repository at this point in the history
  • Loading branch information
shroominic committed Feb 13, 2024
1 parent 4ba7c6b commit 0b6bdc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/funcchain/syntax/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def runnable(
llm: UniversalChatModel = None,
settings: SettingsOverride = {},
auto_tune: bool = False,
) -> Callable[[Callable], Runnable[dict[str, Any], OutputT]]:
) -> Callable[[Callable], Runnable]:
...


Expand All @@ -35,20 +35,20 @@ def runnable(
llm: UniversalChatModel = None,
settings: SettingsOverride = {},
auto_tune: bool = False,
) -> Union[Callable, Runnable]:
) -> Union[Callable, Runnable[dict[str, Any], OutputT]]:
"""Decorator for funcchain syntax.
Compiles the function into a runnable.
"""
if llm:
settings["llm"] = llm

def decorator(f: Callable) -> Runnable:
def decorator(f: Callable) -> Runnable[dict[str, Any], OutputT]:
if not isinstance(f, FunctionType):
raise ValueError("funcchain can only be used on functions")

_signature: dict = gather_signature(f)
_signature["settings"] = create_local_settings(override=settings)
_signature["auto_tune"] = auto_tune
# todo _signature["auto_tune"] = auto_tune

sig: Signature = Signature(**_signature)
return compile_chain(sig)
Expand Down

0 comments on commit 0b6bdc0

Please sign in to comment.