[bug] Phoenix prompt does not preserve original tool definition key order
When users save a prompt with Phoenix, and then fetch that same prompt back, any returned tool definitions have a different key order for their object properties.
While the JSON specification does not mandate the object property order be stable, I do think it is undesirable as a user to save raw json (tool definition) one way, but retrieve it back in another.
See public discussion on this issue, here https://arize-ai.slack.com/archives/C04R3GXC8HK/p1745390622524729
Hi,
I've noticed that Phoenix uses the JSONB type in PostgreSQL to store tools in the prompt_versions table. However, JSONB does not preserve the order of object keys—instead, it stores them based on key length, as mentioned here.
To preserve the original key order, we could consider using the JSON type in PostgreSQL instead.
One thing we can try is to customize the Pydantic serialization and deserialization process specifically to and from the database, so that the function parameters are stored as a (json) string instead.
Hello,
When can we expect this to be included in a release?
Hey @aman-gupta-doc, this fix will be included in the upcoming v9 release, which you can expect in the coming weeks.