nemoguardrails.llm.filters
Module Contents
Functions
API
Returns the previous lines, skipping comments.
Creates a history of user messages and bot responses in colang format.
user said “Hi, how are you today?” bot say “Greetings! I am the official NVIDIA Benefits Ambassador AI bot and I’m here to assist you.” user said “What can you help me with?” bot say “As an AI, I can provide you with a wide range of services, such as …”
Filter that turns an array of events into a colang history.
Filter that turns an array of events into a colang history.
Filter that given a conversation, returns a list of events.
Returns the first n turns from a given colang history.
Indents the provided text with the provided number of spaces.
Returns the last n turns from a given colang history.
Filters that given a history in colang format, removes all texts.
Filter that turns an array of events into a sequence of user/assistant messages.
Properly handles multimodal content by preserving the structure when the content is in the format of a Message object with potential image_url content.
Filter that given a history in colang format, returns all messages.
Filter that given a history in colang 2.0 format, returns all messages.
Filter that turns an array of events into a sequence of user/assistant messages.
For multimodal content, it extracts text content and indicates if there were images.
Filter that given a history in colang format, returns a verbose version of the history.