diff --git a/CHANGELOG.md b/CHANGELOG.md index 140f24969..7f18a03a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - [#58](https://github.com/NVIDIA/NeMo-Guardrails/issues/58): Fix install on Mac OS 13. - [#55](https://github.com/NVIDIA/NeMo-Guardrails/issues/55): Fix bug in example causing config.py to crash on computers with no CUDA-enabled GPUs. - Fixed the model name initialization for LLMs that use the `model` kwarg. +- Fixed the Cohere prompt templates. ## [0.3.0] - 2023-06-30 diff --git a/nemoguardrails/llm/filters.py b/nemoguardrails/llm/filters.py index 6925d3e03..6b6203f3c 100644 --- a/nemoguardrails/llm/filters.py +++ b/nemoguardrails/llm/filters.py @@ -151,30 +151,3 @@ def last_turns(colang_history: str, n: int) -> str: i -= 1 return "\n".join(lines[i:]) - - -# -# def last_turns(colang_history: str, n: int) -> str: -# """Returns the last n turns from a given colang history.""" -# lines = colang_history.split("\n") -# # Remove empty lines -# lines = [line for line in lines if len(line.strip()) > 0] -# lines.reverse() -# -# turn_count = 0 -# diads = [] -# last_diad_id = -1 -# i = 0 -# while i < len(lines): -# if lines[i].startswith('user "'): -# turn_count += 1 -# diad_turns = lines[last_diad_id + 1 : i + 1] -# diad_turns.reverse() -# diads.append("\n".join(diad_turns)) -# last_diad_id = i -# if turn_count == n: -# break -# i += 1 -# -# diads.reverse() -# return "\n".join(diads)