fix(actions): rename generate_next_step to generate_next_steps for task-specific LLM support#1603
fix(actions): rename generate_next_step to generate_next_steps for task-specific LLM support#1603
Conversation
…sk-specific LLM support Fixes a naming mismatch bug where the action `generate_next_step` (singular) didn't match the Task enum value `generate_next_steps` (plural). This mismatch prevented task-specific LLM configuration from working correctly. When users configured a task-specific LLM with `type: generate_next_steps` in their config, the runtime would look for `generate_next_step_llm` (based on the action name) but the config registered `generate_next_steps_llm`, causing the task to fall back to the main LLM instead.
Greptile OverviewGreptile SummaryFixed critical naming mismatch bug where the action Key Changes:
Impact:
|
| Filename | Overview |
|---|---|
| nemoguardrails/actions/llm/generation.py | Renamed action method from generate_next_step to generate_next_steps to match Task enum value |
| nemoguardrails/rails/llm/llm_flows.co | Updated Colang flow to execute generate_next_steps action instead of generate_next_step |
| tests/test_task_specific_model.py | New comprehensive test validating task-specific LLM configuration for generate_next_steps action |
Sequence Diagram
sequenceDiagram
participant User
participant Config
participant LLMRails
participant Runtime
participant Action as generate_next_steps
Note over User,Config: Before Fix (Bug)
User->>Config: Configure type: generate_next_steps
Config->>LLMRails: Register generate_next_steps_llm
LLMRails->>Runtime: Store as "generate_next_steps_llm"
Note over Runtime,Action: Action named "generate_next_step"
Runtime->>Runtime: Look for "generate_next_step_llm"
Runtime->>Action: Not found! Use main LLM instead ❌
Note over User,Config: After Fix (Working)
User->>Config: Configure type: generate_next_steps
Config->>LLMRails: Register generate_next_steps_llm
LLMRails->>Runtime: Store as "generate_next_steps_llm"
Note over Runtime,Action: Action renamed to "generate_next_steps"
Runtime->>Runtime: Look for "generate_next_steps_llm"
Runtime->>Action: Found! Use task-specific LLM ✓
Additional Comments (11)
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 64:64
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 90:90
Comment:
comment still references the old action name `generate_next_step`
```suggestion
# generate_user_intent, generate_next_steps, or generate_bot_message
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 115:115
Comment:
comment still references the old action name `generate_next_step`
```suggestion
# generate_user_intent, generate_next_steps, or generate_bot_message
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 140:140
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_llama_guard.py
Line: 166:166
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 94:94
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 123:123
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 152:152
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 181:181
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 208:208
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix With AIThis is a comment left during a code review.
Path: tests/test_patronus_lynx.py
Line: 237:237
Comment:
comment still references the old action name `generate_next_step`
```suggestion
"Mock generated next step", # mock response for the generate_next_steps action
```
How can I resolve this? If you propose a fix, please make it concise. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Description
Fixes a naming mismatch bug where the action
generate_next_step(singular) didn't match the Task enum valuegenerate_next_steps(plural). This mismatch prevented task-specific LLM configuration from working correctly.When users configured a task-specific LLM with
type: generate_next_stepsin their config, the runtime would look forgenerate_next_step_llm(based on the action name) but the config registeredgenerate_next_steps_llm, causing the task to fall back to the main LLM instead.