I/O and utility modules

chatbot_eval.io.csv_loader.load_samples_from_csv(path)[source]

Load samples from a CSV file with question and expected_answer columns.

Parameters:

path (str | Path)

Return type:

List[Sample]

chatbot_eval.io.reporting.write_rows_csv(rows, path)[source]

Persist evaluation rows to CSV.

Parameters:
  • rows (list[dict])

  • path (str | Path)

Return type:

None

chatbot_eval.io.reporting.write_rows_jsonl(rows, path)[source]

Persist evaluation rows to JSON Lines.

Parameters:
  • rows (list[dict])

  • path (str | Path)

Return type:

None

chatbot_eval.io.reporting.summarize_by_bot(rows)[source]

Average numeric metrics per bot across all rows.

Parameters:

rows (list[dict])

Return type:

list[dict]

chatbot_eval.utils.files.resolve_env(value)[source]

Resolve ${ENV_VAR} placeholders recursively in Python objects.

Parameters:

value (Any)

Return type:

Any

chatbot_eval.utils.files.load_json(path)[source]

Load JSON and resolve environment placeholders.

Parameters:

path (str | Path)

Return type:

dict[str, Any]

chatbot_eval.utils.files.load_text(path)[source]

Load text content from disk.

Parameters:

path (str | Path)

Return type:

str

chatbot_eval.utils.files.render_template(path, **kwargs)[source]

Render a string.Template file from disk.

Parameters:
  • path (str | Path)

  • kwargs (str)

Return type:

str