azai91
09/27/2025, 4:01 PMYosh[promptfoo]
10/01/2025, 10:19 PMdef 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