From 0b6bdc03e5a7799cf5252fa5f7c8fbc5c50a0dbb Mon Sep 17 00:00:00 2001 From: Shroominic Date: Tue, 13 Feb 2024 17:35:23 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix=20decorator=20typing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/funcchain/syntax/decorators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/funcchain/syntax/decorators.py b/src/funcchain/syntax/decorators.py index a35b5d5..b9e30c1 100644 --- a/src/funcchain/syntax/decorators.py +++ b/src/funcchain/syntax/decorators.py @@ -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]: ... @@ -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)