An idea for improving the Add Example page, writing the dict directly is tricky esp. when the value contains newlines, or a json (with many escaped characters). One idea for improving the UI is to enable user to add value for individual keys.
Phoenix currently requires users to input the entire JSON object for fields like input, output, and metadata when adding an example, which can be cumbersome if values contain newlines or complex JSON, as seen in the use of a JSONEditor for these fields. There is no built-in UI for editing individual key-value pairs directly; users must edit the full JSON string for each field (EditExampleDialog.tsx, SpanToDatasetExampleDialog.tsx).Would you like more detail on how the current JSON editing works or suggestions for possible UI improvements?Sources:
- EditExampleDialog.tsx
- SpanToDatasetExampleDialog.tsx
馃挕聽Hint: Mention RunLLM in the thread for followups.
not exactly sure what you mean by a form field. I'm thinking of something like this for each of input, output, and metadata
It sounds like you mainly want a way to enter complex text and values
Makes sense. There may be some subtleties to consider since we don't know the type of the value a priori without a schema on the dataset examples. Feel free to file us an enhancement request!
I thought only text is allowed for the value, no?
You could have any valid JSON type as the value: text, list, object, etc.
wait, I thought json has to be serialized to be a value, no? Otherwise, how does rendering work on the UI?
I just mean it's probably nicer to have a JSON editor than a plain text editor if the value is JSON.
