Skip to content

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

Description

@Aburke225

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomersragRetrieval & generationtier-1Starter difficulty

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions