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: