chore: import upstream snapshot with attribution
Deploy local.promptfoo.app / Deploy to Cloudflare Pages (push) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
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) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
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) Waiting to run
Test and Publish Multi-arch Docker Image / test (push) Waiting to run
Test and Publish Multi-arch Docker Image / build-docker-and-push-digests (map[digest-suffix:linux-amd64 platform:linux/amd64 runner:ubuntu-latest]) (push) Blocked by required conditions
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) Blocked by required conditions
Test and Publish Multi-arch Docker Image / merge-docker-digests (push) Blocked by required conditions
Test and Publish Multi-arch Docker Image / Attest Multi-arch Image (push) Blocked by required conditions
Validate Renovate Config / Validate Renovate Configuration (push) Waiting to run
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
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
# eval-self-grading (Self Grading)
|
||||
|
||||
You can run this example with:
|
||||
|
||||
```bash
|
||||
npx promptfoo@latest init --example eval-self-grading
|
||||
cd eval-self-grading
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
This example shows how you can have an LLM grade its own output according to predefined expectations.
|
||||
|
||||
The configuration is provided in `promptfooconfig.yaml`.
|
||||
|
||||
Run:
|
||||
|
||||
```bash
|
||||
promptfoo eval
|
||||
```
|
||||
|
||||
You can also define the tests in a CSV file:
|
||||
|
||||
```bash
|
||||
promptfoo eval --tests tests.csv
|
||||
```
|
||||
@@ -0,0 +1,21 @@
|
||||
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
|
||||
description: Automatic response evaluation using LLM rubric scoring
|
||||
|
||||
prompts:
|
||||
- file://prompts.txt
|
||||
providers:
|
||||
- openai:chat:gpt-5.4
|
||||
defaultTest:
|
||||
assert:
|
||||
- type: llm-rubric
|
||||
value: Do not mention that you are an AI or chat assistant
|
||||
- type: javascript
|
||||
# Shorter is better
|
||||
value: Math.max(0, Math.min(1, 1 - (output.length - 100) / 900));
|
||||
tests:
|
||||
- vars:
|
||||
name: Bob
|
||||
question: Can you help me find a specific product on your website?
|
||||
- vars:
|
||||
name: Jane
|
||||
question: Do you have any promotions or discounts currently available?
|
||||
@@ -0,0 +1,5 @@
|
||||
You're an ecommerce chat assistant for a shoe company.
|
||||
Answer this user's question: {{name}}: "{{question}}"
|
||||
---
|
||||
You're a smart, bubbly customer service rep for a shoe company.
|
||||
Answer this user's question concisely: {{name}}: "{{question}}"
|
||||
@@ -0,0 +1,11 @@
|
||||
name,question,__expected
|
||||
Bob,Can you help me find a specific product on your website?,grade:Do not mention that you are an AI or chat assistant
|
||||
Jane,Do you have any promotions or discounts currently available?,grade:Do not mention that you are an AI or chat assistant
|
||||
Dave,What are your shipping and return policies?,grade:Do not mention that you are an AI or chat assistant
|
||||
Jim,Can you provide more information about the product specifications or features?,grade:Do not mention that you are an AI or chat assistant
|
||||
Alice,Can you recommend products that are similar to what I've been looking at?,grade:Do not mention that you are an AI or chat assistant
|
||||
Sophie,Do you have any recommendations for products that are currently popular or trending?,grade:Do not mention that you are an AI or chat assistant
|
||||
Ben,Can you check the availability of a product at a specific store location?,grade:Do not mention that you are an AI or chat assistant
|
||||
Jessie,How can I track my order after it has been shipped?,grade:Do not mention that you are an AI or chat assistant
|
||||
Kim,What payment methods do you accept?,grade:Do not mention that you are an AI or chat assistant
|
||||
Emily,Can you help me with a problem I'm having with my account or order?,grade:Do not mention that you are an AI or chat assistant
|
||||
|
Reference in New Issue
Block a user