oyebahadur
10/13/2025, 1:42 PM[Promptfoo] Faizan
10/13/2025, 8:35 PMoyebahadur
10/15/2025, 5:55 AMyaml
prompts:
- just say "hello"
defaultTest:
assert:
- test 1
- test 2
options:
provider:
id: azure:chat:gpt-4.1
transform: file://judgement.py:replace_output
tests:
- path: file://judgement.py:create_tests
providers:
- id: azure:chat:gpt-4o-mini # Use the cheapest provider, coz all we need is a hello.
I generate test cases programmatically (its just a list of [role, content] messages). I include the "output" from my logs as another var (called output)
Sample test case:
json
{
"vars": {
"messages": [
{
"role": "user",
"content": "some utterance"
},
{
"role": "assistant",
"content": {}
],
"output": {
"response": "something that was observed from the prod LLM output",
"other field": "whatever",
},
},
"description": "acid=51, turn=1, total=2, intent_agent",
"metadata": {
"conversationId": "01K7469T9BWCPRV690ERPRNBGM",
"turn": 1,
"turns": 2,
"relevance": 0.0,
"score": 0.0,
"agent_name": "intent_agent",
}
}
I use messages and other vars in my LLM-as-judge assertions.
Here is the one-liner transform function that replaces the LLM output with the var output
py
# judgement.py
def replace_output(output, context) -> str:
return context['vars']['output']