Bot modules

class chatbot_eval.bots.base.BaseBot[source]

Bases: ABC

Minimal text-in/text-out bot contract.

name: str
abstractmethod answer(question)[source]

Return the bot response for question.

Parameters:

question (str)

Return type:

BotResult

class chatbot_eval.bots.full_context.FullContextBot(name, chat_client, prompt_path, domain_knowledge_path)[source]

Bases: BaseBot

A simple generative bot backed by one prompt and the full knowledge base.

Parameters:
  • name (str)

  • chat_client (object)

  • prompt_path (str | Path)

  • domain_knowledge_path (str | Path)

name: str
chat_client: object
prompt_path: str | Path
domain_knowledge_path: str | Path
answer(question)[source]

Return the bot response for question.

Parameters:

question (str)

Return type:

BotResult

class chatbot_eval.bots.semantic_match.StrictSemanticMatchBot(name, faq_csv_path)[source]

Bases: BaseBot

Return the answer from the most similar FAQ question without generation.

Parameters:
  • name (str)

  • faq_csv_path (str | Path)

name: str
faq_csv_path: str | Path
answer(question)[source]

Return the bot response for question.

Parameters:

question (str)

Return type:

BotResult

class chatbot_eval.bots.factory.BotFactory[source]

Bases: object

Create concrete bots from configuration files.

static from_config(project_root, bot_config_path, faq_csv_path, domain_knowledge_path)[source]
Parameters:
  • project_root (Path)

  • bot_config_path (Path)

  • faq_csv_path (Path)

  • domain_knowledge_path (Path)