Hello there, I am using Arize Phoenix with Llama Index like so
import phoenix as px
px.launch_app()
from llama_index.core import set_global_handler
set_global_handler("arize_phoenix")
px.active_session().view()I am running queries in a loop and I notice I tend to only get the trace of the last query only. Is there anyway to fix it so I get the stack traces of all the queries in that looop?
how is your loop written?
I basically loop over my queries I want to ask task = asyncio.create_task for every query I need to run. asyncio.gather runs them all.
i see. does it work if you use a regular loop without async?
what's interesting is the UI doesn't show all the queries but if I look into
from phoenix.trace.llama_index import (
OpenInferenceTraceCallbackHandler,
)
callback_handler = OpenInferenceTraceCallbackHandler()
callback_handler._eventdataI see all the queries.
which version of phoenix are you using right now?
I'm using this
arize-phoenix==3.3.0
llama-index-callbacks-arize-phoenix==0.1.4
llama-index-callbacks-openinference==0.1.4I'll need to test regular loop without async.
another question I'm following this tutorial here https://docs.llamaindex.ai/en/stable/examples/callbacks/OpenInferenceCallback.html
query_data_buffer = callback_handler.flush_query_data_buffer()
query_dataframe = as_dataframe(query_data_buffer)
query_dataframeflush_query_data_buffer actually clear the buffer right? Because I keep seeing Empty DataFrame. after logging query_dataframe.
sorry for all the questions 馃槄
no worries. happy to help!
that tutorial is for a different callback (sorry for the name confusion) that you probably don鈥檛 need
i think the problem is probably async since you aren鈥檛 supposed to see anything inside _eventdata
ok i'll play around more. thanks. There's 2 callbacks from arize.
from llama_index.callbacks.openinference import OpenInferenceCallbackHandlerand there's
from phoenix.trace.llama_index import (
OpenInferenceTraceCallbackHandler,
)I should be using the phoenix.trace one for debugging my trace right?
yea, that鈥檚 right. the following line is supposed to be all you need
set_global_handler("arize_phoenix")btw, are you using streaming queries by any chance?
