To use a nested JSON input in the Phoenix playground, ensure your dataset row is a valid JSON object and upload it as a dataset. The playground will expose each top-level key (e.g., `messages`, `current_report`) as a template variable, which you can reference in your prompt using the template language (e.g., `{{messages}}` for mustache or `{messages}` for f-string). When running the prompt, Phoenix will substitute these variables with the corresponding values from your JSON input. For example, your dataset row should look like:
```
{
"current_report": "",
"messages": [
{
"content": "",
"additional_kwargs": {},
"response_metadata": {},
"id": ""
}
],
"highlighted_report_section": "",
"runtime_functions": [
{
"ID": "",
"description": ""
}
],
"mode": "",
"approved_report_plan": null,
"environment_id": "",
"field_documentation": "",
"sample_data_context": "{}",
"cached_processed_documentation": ""
}
```
Upload this as a dataset, then reference variables in your prompt template as needed. For more, see <https://github.com/Arize-ai/phoenix/blob/main/docs/prompt-engineering/how-to-prompts/using-the-playground.md|Using Datasets with Prompts> and <https://arize.com/docs/phoenix/datasets-and-experiments/how-to-datasets/creating-datasets|Creating Datasets>.
Would you like more detail or a code example?
Sources:
- <https://github.com/Arize-ai/phoenix/blob/main/docs/prompt-engineering/how-to-prompts/using-the-playground.md|Using Datasets with Prompts>