0d3cb498a3
CI / Shell Format Check (push) Has been cancelled
CI / Check Ruby (3.4) (push) Has been cancelled
CI / CI Config (push) Has been cancelled
CI / Test on Node ${{ matrix.node }} and ${{ matrix.os }}${{ matrix.shard && format(' (shard {0}/3)', matrix.shard) || '' }} (push) Has been cancelled
CI / Build on Node ${{ matrix.node }} (push) Has been cancelled
CI / Style Check (push) Has been cancelled
CI / Generate Assets (push) Has been cancelled
CI / Check Python (3.14) (push) Has been cancelled
CI / Check Python (3.9) (push) Has been cancelled
CI / Build Docs (push) Has been cancelled
CI / Code Scan Action (push) Has been cancelled
CI / Site tests (push) Has been cancelled
CI / webui tests (push) Has been cancelled
CI / Run Integration Tests (push) Has been cancelled
CI / Run Smoke Tests (push) Has been cancelled
CI / Go Tests (push) Has been cancelled
CI / Share Test (push) Has been cancelled
CI / Redteam (Production API) (push) Has been cancelled
CI / Redteam (Staging API) (push) Has been cancelled
CI / GitHub Actions Lint (push) Has been cancelled
CI / Check Ruby (3.0) (push) Has been cancelled
release-please / release-please (push) Has been cancelled
release-please / build (push) Has been cancelled
release-please / publish-npm (push) Has been cancelled
release-please / publish-npm-backfill (push) Has been cancelled
release-please / docker (push) Has been cancelled
release-please / publish-code-scan-action (push) Has been cancelled
release-please / attest-code-scan-action (push) Has been cancelled
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Has been cancelled
Test and Publish Multi-arch Docker Image / test (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-arm64 platform:linux/arm64 runner:ubuntu-24.04-arm]) (push) Has been cancelled
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Has been cancelled
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Has been cancelled
Validate Renovate Config / Validate Renovate Configuration (push) Has been cancelled
106 lines
3.8 KiB
YAML
106 lines
3.8 KiB
YAML
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
|
description: D&D Adventure with AI Dungeon Master
|
|
|
|
prompts:
|
|
- '{{query}}'
|
|
|
|
providers:
|
|
- id: openai:agents:dungeon-master
|
|
config:
|
|
agent: file://./agents/dungeon-master-agent.ts
|
|
tools: file://./tools/game-tools.ts
|
|
maxTurns: 20
|
|
# tracing: true # Enable when OTLP collector is running
|
|
|
|
tests:
|
|
- description: Dragon combat with attack roll
|
|
vars:
|
|
query: 'I draw my longsword and attack the red dragon!'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: Response includes dice rolls for attack and damage, describes combat outcome dramatically
|
|
- type: javascript
|
|
value: |
|
|
// Should use roll_dice tool and mention dice
|
|
return (output.toLowerCase().includes('roll') || output.toLowerCase().includes('d20')) &&
|
|
(output.toLowerCase().includes('attack') || output.toLowerCase().includes('hit'));
|
|
|
|
- description: Check character stats before battle
|
|
vars:
|
|
query: 'What are my character stats and current HP?'
|
|
assert:
|
|
- type: contains-any
|
|
value: ['Thorin', 'Fighter', 'level 5']
|
|
- type: javascript
|
|
value: |
|
|
// Should mention HP or hit points
|
|
return output.toLowerCase().includes('hp') || output.toLowerCase().includes('hit points');
|
|
|
|
- description: Check inventory and equipment
|
|
vars:
|
|
query: 'What weapons and items do I have with me?'
|
|
assert:
|
|
- type: contains
|
|
value: Longsword
|
|
- type: contains
|
|
value: Potion
|
|
- type: javascript
|
|
value: |
|
|
// Should mention gold
|
|
return output.includes('gold') || output.includes('gp');
|
|
|
|
- description: Enter ominous dungeon with scene description
|
|
vars:
|
|
query: 'I cautiously enter the ancient crypt, torch held high'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: Response paints vivid atmospheric scene with sensory details and presents clear choices
|
|
- type: javascript
|
|
value: |
|
|
// Should be descriptive (>100 chars) and mention darkness/light
|
|
return output.length > 100 &&
|
|
(output.toLowerCase().includes('dark') ||
|
|
output.toLowerCase().includes('torch') ||
|
|
output.toLowerCase().includes('shadows'));
|
|
|
|
- description: Saving throw during trap
|
|
vars:
|
|
query: 'I step on a pressure plate and hear a click. What happens?'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: Response triggers trap, asks for saving throw, rolls dice, and describes outcome
|
|
- type: javascript
|
|
value: |
|
|
// Should mention saving throw or roll
|
|
return output.toLowerCase().includes('save') || output.toLowerCase().includes('saving throw');
|
|
|
|
- description: Critical hit celebration
|
|
vars:
|
|
query: 'I attack the goblin with my longsword!'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: Response includes attack roll mechanics and outcome description
|
|
|
|
- description: Ridiculous player action
|
|
vars:
|
|
query: 'I attempt to seduce the ancient dragon using interpretive dance'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: DM responds with humor and wit while keeping the game engaging and asking for appropriate roll
|
|
|
|
- description: Request for short rest
|
|
vars:
|
|
query: 'I want to take a short rest to recover'
|
|
assert:
|
|
- type: llm-rubric
|
|
value: Response explains short rest mechanics and asks what the character does during rest
|
|
|
|
- description: Mysterious magic item examination
|
|
vars:
|
|
query: 'I examine the Mysterious Amulet in my inventory more closely'
|
|
assert:
|
|
- type: contains-any
|
|
value: ['undead', 'glow', 'amulet']
|
|
- type: llm-rubric
|
|
value: Response provides intriguing details about the magic item
|