Help with using Feedback().on(). #2173
Unanswered
tfs-hendricks
asked this question in
Q&A
Replies: 1 comment 2 replies
-
The error happens because Feedback().on() expects a Lens, not a Selector. To fix this, wrap your Selector in a Lens using Lens.from_selector. Here’s how you can do it: from trulens_eval.schema.lenses import Lens
from trulens_eval.schema.selector import Selector
f_logical_consistency = (
Feedback(provider.trajectory_logical_consistency_with_cot_reasons)
.on({
"trace": Lens.from_selector(Selector(trace_level=True)),
})
) This will let Feedback extract the agent trajectory correctly for evaluation. Passing a raw Selector only works in OTEL mode, which is not the default and not recommended for most users. For standard usage, always convert your Selector to a Lens before passing it to .on() source. To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
https://www.trulens.org/reference/trulens/providers/litellm/provider/#trulens.providers.litellm.provider.LiteLLM.trajectory_logical_consistency_with_cot_reasons
When trying to run
I keep getting the error
ValueError: Expected a Lens but got Selector(trace_level=True, function_name=None, span_name=None, span_type=None, span_attributes_processor=None, span_attribute=None, function_attribute=None, ignore_none_values=False, collect_list=True, match_only_if_no_ancestor_matched=False) of type Selector.
How do I set this correctly so that it will take the evaluate the trajectory of the agent?
Beta Was this translation helpful? Give feedback.
All reactions