Hello, Is there any way I can get the Phoenix to return span id to my application? I want to add user feedback and some other custom eval metrics to the span id.
Hi Vipul, I'd say the only workaround for human feedback right now is logging evaluations. In terms of what ID to use to send the evaluation, I think the most advisable solution would be to create your own ID and to place it in metadata attributes. This way you don't have to rely on trace / span ids from OTEL. You can then pull down spans and perform a join to send the feedback in bulk. Definitely leave us your use-case in the above issue!
I was able to add metadata to LCEL during invocation using below:
chain.invoke("Hello, How are you doing?", config={'metadata': {'uuid': 1}})The phoenix docs mention adding metadata to the LLM chain. LCEL returns a RunnableSequence which, iiuc, does not have any option to add metadata at the chain level.
Oh interesting. So I鈥檓 guessing you can鈥檛 add metadata to RunnableSequence? That鈥檚 a bit odd on LC鈥檚 part. I think querying off of invocation metadata might be a tad tough but let us know how it goes. We might have solutions for you in the near future
querying off of invocation metadata might be a tad tough
Wondering why it would be difficult? I am not seeing any difference in setting metadata during invocation vs setting in chain (I tried both using RetrievalQA chain). Below uuid is set via invocation and application_type is set via chain
{"uuid": 1, "application_type": "question_answering"}I am able to query the invocation metadata successfully.
So I'm guessing you can't add metadata to RunnableSequence? Right
No problem!
