Phoenix does not expose a public API or SDK method specifically for transforming a list of traces into a tree structure based on parent_id. However, the internal UI and backend logic do construct such trees for visualization, using functions like createSpanTree, but these are not documented or available as part of the Python SDK or public API (source). If you need this functionality, you would need to implement the tree-building logic yourself by grouping spans by parent_id.Would you like more detail on how Phoenix internally handles this or example code for building such a tree in Python?Sources:
- GitHub Issue: Show spans to the UI as soon as they arrive
💡Hint: Mention RunLLM in the thread for followups.