Skip to content

Commit 45f6c67

Browse files
committed
feat(llm): pass llm params directly (#1387)
* feat(llm): add llm_params option to llm_call Extend llm_call to accept an optional llm_params dictionary for passing configuration parameters (e.g., temperature, max_tokens) to the language model. This enables more flexible control over LLM behavior during calls. refactor(llm): replace llm_params context manager with argument Update all usages of the llm_params context manager to pass llm_params as an argument to llm_call instead. This simplifies parameter handling and improves code clarity for LLM calls. docs: clarify prompt customization and llm_params usage update LLMChain config usage
1 parent af4e717 commit 45f6c67

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

nemoguardrails/actions/v2_x/generation.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,7 @@ async def passthrough_llm_action(
457457

458458
generation_options: GenerationOptions = generation_options_var.get()
459459

460-
generation_llm_params = (
461-
generation_options and generation_options.llm_params
462-
) or {}
460+
generation_llm_params = generation_options and generation_options.llm_params
463461
text = await llm_call(
464462
llm,
465463
user_message,

0 commit comments

Comments
 (0)