From 9db6fd67e17f2d1a162991d82731fd420ae68a54 Mon Sep 17 00:00:00 2001 From: hmasdev Date: Sun, 27 Oct 2024 21:49:52 +0900 Subject: [PATCH] Refactor create_input_runnable in io.py --- langchain_werewolf/io.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/langchain_werewolf/io.py b/langchain_werewolf/io.py index a556ac4..cae02e2 100644 --- a/langchain_werewolf/io.py +++ b/langchain_werewolf/io.py @@ -23,17 +23,15 @@ def create_input_runnable( input_func: Callable[[str], Any] | EInputOutputType = click.prompt, styler: Callable[[str], str] | None = None, - **kwargs, ) -> Runnable[str, str]: if isinstance(input_func, EInputOutputType): try: input_func = _input_map[input_func] except KeyError: raise ValueError(f'Invalid input_func: {input_func}') - kwargs = {k: v for k, v in kwargs.items() if k != 'styler'} return ( (RunnableLambda(styler) if styler else RunnablePassthrough()) - | RunnableLambda(partial(input_func, **kwargs)) + | RunnableLambda(input_func) | RunnableLambda(str) ).with_types( input_type=str,