-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
38a8f8f
commit 592267f
Showing
3 changed files
with
40 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
""" | ||
Filters. | ||
--------- | ||
This module contains a collection of basic functions for history filtering to avoid cluttering LLMs context window. | ||
""" | ||
|
||
from chatsky.script.core.message import Message | ||
|
||
def is_important(msg: Message) -> bool: | ||
if msg.misc["important"]: | ||
return True | ||
return False | ||
|
||
def from_the_model(msg: Message, model_name: str) -> bool: | ||
return msg.annotation.__generated_by_model__ == model_name |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters