Skip to content

Commit

Permalink
Randomly run evals based on record_id hash (#850)
Browse files Browse the repository at this point in the history
* prototype

* update md

* fix run_feedback

* update

* update

* update
  • Loading branch information
joshreini1 authored Feb 6, 2024
1 parent 170b2c7 commit 4af9969
Show file tree
Hide file tree
Showing 2 changed files with 394 additions and 8 deletions.
12 changes: 4 additions & 8 deletions docs/trulens_eval/feedback_functions_existing_data.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,11 @@ feedback_result = provider.relevance("<some prompt>", "<some response>")
In the case that you have already logged a run of your application with TruLens and have the record available, the process for running an (additional) evaluation on that record is by using `tru.run_feedback_functions`:

```python
tru_recorder = TruChain(
chain,
app_id='Chain1_ChatApplication'
)

with tru_recorder as recording:
record = chain(""What is langchain?")
tru_rag = TruCustomApp(rag, app_id = 'RAG v1')

tru.run_feedbacks(record, feedbacks=[f_lang_match, f_qa_relevance, f_context_relevance])
result, record = tru_rag.with_record(rag.query, "How many professors are at UW in Seattle?")
feedback_results = tru.run_feedback_functions(record, feedbacks=[f_lang_match, f_qa_relevance, f_context_relevance])
tru.add_feedbacks(feedback_results)
```

### TruVirtual
Expand Down
Loading

0 comments on commit 4af9969

Please sign in to comment.