Skip to content

Commit 82c8ddb

Browse files
committed
refactor: remove support for deprecated NeMo LLM model
1 parent c5da691 commit 82c8ddb

File tree

14 files changed

+38
-876
lines changed

14 files changed

+38
-876
lines changed

examples/configs/llm/nemollm/README.md

Lines changed: 0 additions & 22 deletions
This file was deleted.

examples/configs/llm/nemollm/config.yml

Lines changed: 0 additions & 46 deletions
This file was deleted.

examples/configs/llm/nemollm/rails.co

Lines changed: 0 additions & 20 deletions
This file was deleted.

examples/configs/streaming/config.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,6 @@ models:
99
engine: openai
1010
model: gpt-4
1111

12-
# # Uncomment this and comment the 3 lines above to test with NeMo LLM.
13-
# - type: main
14-
# engine: "nemollm"
15-
# model: "gpt-43b-905"
16-
1712
rails:
1813
dialog:
1914
single_call:

nemoguardrails/llm/filters.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import re
1717
import textwrap
18+
import warnings
1819
from typing import List
1920

2021
from nemoguardrails.actions.llm.utils import (
@@ -100,7 +101,7 @@ def co_v2(
100101
history += f' bot say "{event["script"]}"\n'
101102

102103
elif event["type"] == "StartTool":
103-
s = f' await {event["flow_name"]}'
104+
s = f" await {event['flow_name']}"
104105
for k, v in event.items():
105106
if k in [
106107
"type",
@@ -400,6 +401,12 @@ def user_assistant_sequence_nemollm(events: List[dict]) -> str:
400401
I can help with many things.
401402
```
402403
"""
404+
405+
warnings.warn(
406+
"user_assistant_sequence_nemollm is deprecated and will be removed in a future release.",
407+
DeprecationWarning,
408+
stacklevel=2,
409+
)
403410
history_items = []
404411
for event in events:
405412
if event["type"] == "UserMessage":
@@ -413,6 +420,7 @@ def user_assistant_sequence_nemollm(events: List[dict]) -> str:
413420

414421
def _previous_line(lines: List[str], i: int):
415422
"""Returns the previous lines, skipping comments."""
423+
416424
i = i - 1
417425
while i > 0 and lines[i].strip().startswith("#"):
418426
i -= 1
@@ -422,6 +430,12 @@ def _previous_line(lines: List[str], i: int):
422430
def to_messages_nemollm(colang_history: str) -> str:
423431
"""Filter that given a history in colang format, returns a messages string
424432
in the chat format used by NeMo LLM models."""
433+
434+
warnings.warn(
435+
"to_messages_nemollm is deprecated and will be removed in a future release.",
436+
DeprecationWarning,
437+
stacklevel=2,
438+
)
425439
messages = []
426440

427441
# For now, we use a simple heuristic. The line `user "xxx"` gets translated to

nemoguardrails/llm/prompts/nemollm.yml

Lines changed: 0 additions & 189 deletions
This file was deleted.

0 commit comments

Comments
 (0)