From c45b5051921506580f136cbc0cca9849b5ce4c8d Mon Sep 17 00:00:00 2001 From: Shroominic Date: Fri, 28 Jun 2024 16:20:04 -0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20fix=20llm=20argument=20in=20chai?= =?UTF-8?q?n/achain?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/funcchain/syntax/executable.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/funcchain/syntax/executable.py b/src/funcchain/syntax/executable.py index dae60ae..7991366 100644 --- a/src/funcchain/syntax/executable.py +++ b/src/funcchain/syntax/executable.py @@ -33,6 +33,8 @@ def chain( """ Generate response of llm for provided instructions. """ + if llm: + settings_override["llm"] = llm settings = create_local_settings(settings_override) callbacks: Callbacks = None output_types = get_output_types() @@ -41,9 +43,6 @@ def chain( memory = memory or ChatMessageHistory() input_kwargs.update(kwargs_from_parent()) - if llm: - settings_override["llm"] = llm - # todo maybe this should be done in the prompt processor? system = system or settings.system_prompt if system: @@ -87,6 +86,8 @@ async def achain( """ Asyncronously generate response of llm for provided instructions. """ + if llm: + settings_override["llm"] = llm settings = create_local_settings(settings_override) callbacks: Callbacks = None output_types = get_output_types() @@ -95,9 +96,6 @@ async def achain( memory = memory or ChatMessageHistory() input_kwargs.update(kwargs_from_parent()) - if llm: - settings_override["llm"] = llm - # todo maybe this should be done in the prompt processor? system = system or settings.system_prompt if system: