ChatBot.avoid()

Configure topics or behaviors the chatbot must refuse to engage with.

Usage

Source

ChatBot.avoid(avoid_list)

The avoid list feeds into both the system prompt (instructing the LLM to decline requests on these topics) and the autotest_avoid_topics() testing framework that validates compliance.

Parameters

avoid_list: list[str]
A list of topic strings the chatbot should not discuss or assist with (e.g., ["medical_advice", "legal_advice"]).

Returns

ChatBot
The same instance for method chaining.

Examples

import talk_box as tb

bot = tb.ChatBot().avoid(["medical_advice", "financial_planning"])
bot.get_avoid_topics()
['medical_advice', 'financial_planning']