An error occurred: Some selectors do not exist in the app or record. #1521
Replies: 1 comment
-
To resolve the error "Source of argument context to Context Relevance (CoT) does not exist in app or expected record," you need to ensure that the structure of your application matches the expected structure that these selectors are trying to access. First, inspect the JSON-like structure of your application to verify that the paths response = my_llm_app(query)
from trulens_eval import TruChain
tru_recorder = TruChain(
my_llm_app,
app_id='Chain1_ChatApplication'
)
response, tru_record = tru_recorder.with_record(my_llm_app, query)
json_like = tru_record.layout_calls_as_app()
# Print the JSON-like structure to inspect it
import json
print(json.dumps(json_like, indent=2)) After inspecting the structure, ensure that the paths you are using in your selectors exist. If they do not, you will need to adjust your selectors to match the actual structure of your application. For example, if the structure shows that the correct path is context = Select.RecordCalls.retrieve.rets If the structure is more complex and involves multiple levels, ensure that each level exists and is correctly referenced in your selector. Additionally, if you encounter an from trulens_eval.feedback.feedback import InvalidSelector
try:
input_combinations = list(
self._extract_selection(
source_data=source_data,
combinations=self.combinations,
**kwargs
)
)
except InvalidSelector as e:
print(f"Selector {e.selector} does not exist in source data.")
# Handle the missing selector case This approach ensures that you handle missing selectors gracefully and provide meaningful feedback for debugging and resolving the issue [1]. |
Beta Was this translation helpful? Give feedback.
-
I get this error:
With the following code:
I also tried:
with no luck.
Beta Was this translation helpful? Give feedback.
All reactions