LLMFilter#

classDiagram FilterBase <|-- LLMFilter Monitorable <|-- FilterBase
class council.filters.LLMFilter(llm: LLMBase, filter_on: List[str] | None = None)[source]#

Bases: FilterBase

Filter using an LLM to filter chain responses.

__init__(llm: LLMBase, filter_on: List[str] | None = None) None[source]#

Build a new LLMFilter.

Parameters:
  • llm – model to use for the filtering.

  • filter_on – List of filters to filter chain responses on.

execute(context: AgentContext) List[ScoredChatMessage]#

Selects responses from the agent’s context.

Parameters:

context (AgentContext) – The context for selecting responses.

Returns:

A list of scored agent messages representing the selected responses.

Return type:

List[ScoredChatMessage]

Raises:

None

render_as_dict(include_children: bool = True) Dict[str, Any]#

returns the graph of operation as a dictionary

render_as_json() str#

returns the graph of operation as a JSON string