truera / trulens

Evaluation and Tracking for LLM Experiments
https://www.trulens.org/
MIT License
2.14k stars 184 forks source link

Using it with out the Sqllite db #422

Closed ricoyudog closed 1 year ago

ricoyudog commented 1 year ago

Hi Teams The record tracking function is look great! I would like to ask is it possible to use it with out running a db, I mainly want to use it to get the tracking record for each time of my call.

Thank you very much

rshih32 commented 1 year ago

Hi @ricoyudog , Yes you can!

Each tru wrapper has a *_with_record method that has this information populated.

for example: https://www.trulens.org/trulens_eval/api/truchain/

response = my_llm_app(query)

from trulens_eval import TruChain
truchain = TruChain(
    my_llm_app,
    app_id='Chain1_ChatApplication')

response, tru_record = truchain.call_with_record(query)

latency = tru_record.perf.end_time - tru_record.perf.start_time
ricoyudog commented 1 year ago

But it seems like when my pipeline is finished, the terminal is still not close

rshih32 commented 1 year ago

Are you running the dashboard? That kicks off a long living thread that will prevent terminal closing. You can either stop the dashboard with tru.stop_dashboard() or not run the dashboard

Otherwise let me know if I'm not on the right path in understanding your question