https://promptfoo.dev/ logo
Ability to add additional context/metdata in UI
# questions
a
In the web view, do we have a way of show addition data. For example my agent also produces artifacts or summaries and I want to see if these were produced correctly. https://cdn.discordapp.com/attachments/1421527100967358596/1421527101345108122/image.png?ex=68d95bc7&is=68d80a47&hm=4b89e81515433e6b1ce1da1cfad20bc484f79798eebbb34aaa66b562c795ea43&
y
Hey! Good news - this feature already exists! You can return additional data through the metadata key in your provider response, and it will show up in the "Metadata" tab (exactly what you're looking at in your screenshot). How it works:
Copy code
def call_api(prompt, options, context):
    # Your agent logic here
    result = your_agent.run(prompt)
    
    return {
        "output": result.text,
        "metadata": {
            "artifacts": result.artifacts,
            "summary": result.summary,
            "reasoning_steps": result.steps,
            # Any other data you want to inspect
        }
    }
The metadata field accepts any dict and will render as a key-value table in the Metadata tab of the web UI - perfect for debugging artifacts, summaries, or any custom data your agent produces. I just updated the docs to include this: https://github.com/promptfoo/promptfoo/pull/5796 You can check out the ProviderResponse type definition at https://www.promptfoo.dev/docs/providers/python/#types