Skip to content

Faithfulness checker crashes when a context chunk has text: None #153

Description

@ascherj

check() builds the context with chunk.get("text", ""), but when the key is present with value None, .get() returns None (the default applies only to missing keys), and the subsequent " ".join(...) raises TypeError.

Steps to reproduce:

from rag.evaluator.faithfulness_checker import FaithfulnessChecker
FaithfulnessChecker().check('Knows Python.', [{'text': None}])
# observed: TypeError: sequence item 0: expected str instance, NoneType found

Related failing test: test_none_context_chunk_text in tests/unit/test_faithfulness_checker.py.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for first-time contributors (same as tier-1)ragRAG systemtier-1Starter: good for first-time contributors

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions