Repository: truera/trulens
Issue: [BUG]Groundedness / ground_truth_agreement not working
Root cause: Documentation Deficiency

**Bug Description**
Unable to run groundedness / ground_truth_agreement without a glitch

**To Reproduce**
ground_truth_agreement = (
    Feedback(GEMINI_PROVIDER.groundedness_measure_with_cot_reasons, name="Groundedness")
    .on(TruLlama.select_source_nodes().node.text)
    .on_output()
    .aggregate(GroundTruthAgreement.boolean_and_aggregator)
)

**Expected behavior**
The code should run in Pycharm community edition 2024.1 without an error. The code is 
import os
import google.generativeai as genai
import nest_asyncio
import numpy as np
from trulens_eval import Feedback, LiteLLM, TruLlama
# from trulens_eval.feedback import Groundedness
from trulens_eval.feedback import GroundTruthAgreement

genai.configure(api_key=os.environ['GOOGLE_API_KEY'])
nest_asyncio.apply()
GEMINI_PROVIDER = LiteLLM(model_engine='gemini-1.5-flash')

ground_truth_agreement = (
    Feedback(GEMINI_PROVIDER.groundedness_measure_with_cot_reasons, name="Groundedness")
    .on(TruLlama.select_source_nodes().node.text)
    .on_output()
    .aggregate(GroundTruthAgreement.boolean_and_aggregator)
)

**Relevant Logs/Tracebacks**
.aggregate(GroundTruthAgreement.boolean_and_aggregator)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/abc/PycharmProjects/rag_training/.venv/lib/python3.12/site-packages/pydantic/_internal/_model_construction.py", line 242, in __getattr__
    raise AttributeError(item)
AttributeError: boolean_and_aggregator

**Environment:**
-  OS: MacOS
- Python Version: 3.12
- Langchain: 0.2.6
- Langchain- community: 0.2.6
- langchain cli: 0.0.25
- trulens_eval: 0.32.0

**Additional context**
I also tried following from DLAI training and github closed issues but no luck:
Option 1: ground_truth_agreement = (
    Feedback(GEMINI_PROVIDER.ground_truth_measure_with_cot_reasons, name="Ground Truth Agreement")
        .on(TruLlama.select_source_nodes().node.text)
        .on_output()
        .aggregate(GroundTruthAgreement.boolean_and_aggregator)
)

Option 2: f_groundedness = (
    Feedback(provider.groundedness_measure_with_cot_reasons, name = "Groundedness")
    .on(Select.RecordCalls.retrieve.rets.collect())
    .on_output()
) 
Option 1 does not recognise. "ground_truth_measure_with_cot_reasons" and option 2 does not recognise "Select"


Hi @hackrz - it seems like you're mixing the code for groundedness and ground truth agreement which is leading to your errors.

For option 1, if you're looking to measure how similar a response is to the same exact query in a golden set defined by you, you can use our class of [ground truth agreement feedback functions](https://www.trulens.org/trulens_eval/evaluation/feedback_implementations/stock/#ground-truth-agreement)

```python
from trulens_eval import Feedback
from trulens_eval.feedback import GroundTruthAgreement

golden_set = [
    {"query": "who invented the lightbulb?", "response": "Thomas Edison"},
    {"query": "¿quien invento la bombilla?", "response": "Thomas Edison"}
]

f_groundtruth = Feedback(GroundTruthAgreement(golden_set).agreement_measure, name = "Ground Truth").on_input_output()
```

Full example is here: [Ground Truth Evaluations Notebook](https://www.trulens.org/trulens_eval/getting_started/quickstarts/groundtruth_evals/)

For option 2, if you're looking to measure if an LLM response is supported by evidence from source text/context, you can use the [groundedness feedback function](https://www.trulens.org/trulens_eval/evaluation/feedback_implementations/stock/#trulens_eval.feedback.provider.base.LLMProvider.groundedness_measure_with_cot_reasons) as follows:

```python
from trulens_eval import Feedback, Select
from trulens_eval.feedback.provider.openai import OpenAI

import numpy as np

provider = OpenAI()

# Define a groundedness feedback function
f_groundedness = (
    Feedback(provider.groundedness_measure_with_cot_reasons, name = "Groundedness")
    .on(Select.RecordCalls.retrieve.rets.collect())
    .on_output()
)
```

Please re-open if issues persist