Hi, I'm encountering an issue with tool definitions. In my tool, some parameter keys are dependent on others, as referenced in their descriptions鈥攕o the order of keys is important. However, Phoenix stores tool definitions in a JSONB column, which automatically reorders the keys (typically by key length), and this is causing the tool to malfunction. Is there a way to preserve the key order or work around this issue? Also, would it be possible to use a JSON column instead of JSONB to maintain the original key order?
Hey there, thanks for reaching out and sorry you are seeing issues. I would not expect key order to impact behavior, that's interesting. Can you describe a bit more about your use case where key order impacts performance? The json specification does not take a strong stance on object key order but it does recommend that object keys are treated as unordered for maximum compatibility. I think I would agree with that stance as every touch point that the tool json passes through may or may not preserve key order, and I'm not sure that we'd like to limit our technical design in this way. I am curious what others think though.
