-
-
Notifications
You must be signed in to change notification settings - Fork 606
feat: add Microsoft Prompty file format support #4840
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
- Add new processor for parsing and handling .prompty files - Support YAML frontmatter with model configuration and metadata - Convert role-based content (system, user, assistant) to chat format - Support both chat and completion API types - Map Azure OpenAI, OpenAI, and other model configurations - Implement sample data functionality for default variable values - Add comprehensive test coverage (14 unit tests, 3 integration tests) - Update documentation with detailed Prompty section - Add example prompty files demonstrating various features - Support for images in prompts using markdown syntax - Template rendering using existing Nunjucks engine This allows users to seamlessly use their existing Microsoft Prompty files with promptfoo's evaluation and testing capabilities.
- Add support for multiple template engines in prompty files - Default remains Jinja2/Nunjucks for Microsoft compatibility - Optional Handlebars support via 'template: handlebars' in frontmatter - Register common Handlebars helpers (eq, ne, lt, gt, lte, gte) - Add comprehensive tests for both template engines - Update documentation with template engine examples - Create advanced examples demonstrating both syntaxes - Add handlebars dependency to package.json This allows users to choose their preferred template syntax while maintaining backward compatibility with the Microsoft Prompty spec.
- Document that Microsoft Prompty uses Jinja2, not Handlebars - Identify missing core features like environment variables - Recommend removing Handlebars support in favor of spec compliance - Suggest focusing on core features users actually need
- Remove Handlebars support to comply with Microsoft spec - Add environment variable support using ${env:VAR_NAME} syntax - Update input/output type definitions in interface - Simplify documentation to focus on Nunjucks (Jinja2-compatible) - Remove Handlebars examples and dependencies - Add environment variable example - Update all tests to reflect changes BREAKING CHANGE: Removed Handlebars template engine support. Prompty files now only support Nunjucks (Jinja2-compatible) templating as specified by Microsoft.
Add comprehensive support for .prompty files following Microsoft's specification: Features: - YAML frontmatter parsing for metadata and configuration - Chat and completion API support - Nunjucks templating (Jinja2-compatible) for variable substitution - Environment variable support with ${env:VAR_NAME} syntax - Sample data that serves as default values - Multi-turn conversation support - Image support using markdown syntax - Role markers including shorthand (A: for assistant) Configuration mapping: - Azure OpenAI: Maps endpoint, deployment, API version - OpenAI: Maps model name and organization - Azure Serverless: Maps endpoint configuration Examples included: - Basic examples: customer service, technical support, completion - Advanced examples: Azure configuration, image analysis - Environment variable usage demonstration Documentation: - Added comprehensive section to prompts.md - Implementation notes in docs/prompty/ - Example READMEs with usage instructions Testing: - 17 unit tests covering all functionality - Integration tests for file loading - Examples verified with echo provider
Keep documentation in the main site/docs folder only
⏩ No test execution environment matched (fb6bdd8) View output ↗ |
TestGru AssignmentSummary
Files
Tip You can |
📝 WalkthroughWalkthroughThis change introduces comprehensive support for the Microsoft Prompty ( Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
npm error Exit handler never called! ✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 10
🔭 Outside diff range comments (1)
examples/prompty-advanced/promptfooconfig.yaml (1)
1-20
: Fix configuration file structure to follow coding guidelines.This configuration file is missing required elements and doesn't follow the specified field order:
- Missing YAML schema reference at the top
- Missing description field
- Wrong field order (should be: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests)
Apply this diff to fix the structure:
+# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json +description: Advanced Prompty examples demonstrating Azure configurations, multi-turn conversations, and image analysis + prompts: - azure_chatbot.prompty - image_analysis.prompty
🧹 Nitpick comments (3)
examples/prompty-advanced/README.md (1)
31-37
: Add language specifications to code blocks.The static analysis correctly identifies that fenced code blocks should have language specifications for better syntax highlighting and accessibility.
Add language specifications to the code blocks:
-``` +```jinja {% if topic == "quantum computing" %} Quantum computing explanation... {% else %} General explanation... {% endif %} -``` +``` -``` +```jinja {% for item in items %} - {{item.name}}: {{item.description}} {% endfor %} -``` +``` -``` +```jinja Hello {{name | upper}}! The date is {{date | date("YYYY-MM-DD")}}. -``` +``` Also applies to: 41-45, 49-53 </blockquote></details> <details> <summary>test/prompts/processors/prompty.test.ts (1)</summary><blockquote> `345-347`: **Consider using undefined assignment for better performance** While acceptable in test code, using `delete` can impact performance. ```diff // Clean up - delete process.env.TEST_API_KEY; - delete process.env.TEST_ENDPOINT; + process.env.TEST_API_KEY = undefined; + process.env.TEST_ENDPOINT = undefined;src/prompts/processors/prompty.ts (1)
118-118
: Consider handling edge cases in image URL regexThe current regex
!/\[(.*?)\]\((.*?)\)/g
might have issues with URLs containing parentheses, which are valid in URLs.Consider using a more robust regex or a markdown parsing library for better edge case handling:
- const imageRegex = /!\[(.*?)\]\((.*?)\)/g; + // Handle URLs with parentheses by matching balanced or escaped parens + const imageRegex = /!\[(.*?)\]\((<[^>]+>|[^\s)]+(?:\([^\s)]+\)[^\s)]*)?)\)/g;Alternatively, consider using a proper markdown parser for more reliable image extraction.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
package-lock.json
is excluded by!**/package-lock.json
📒 Files selected for processing (20)
.gitignore
(1 hunks)examples/prompty-advanced/README.md
(1 hunks)examples/prompty-advanced/azure_chatbot.prompty
(1 hunks)examples/prompty-advanced/image_analysis.prompty
(1 hunks)examples/prompty-advanced/promptfooconfig.yaml
(1 hunks)examples/prompty-basic/README.md
(1 hunks)examples/prompty-basic/completion_example.prompty
(1 hunks)examples/prompty-basic/customer_service.prompty
(1 hunks)examples/prompty-basic/env_example.prompty
(1 hunks)examples/prompty-basic/promptfooconfig.yaml
(1 hunks)examples/prompty-basic/technical_support.prompty
(1 hunks)package.json
(1 hunks)site/docs/configuration/prompts.md
(1 hunks)src/prompts/constants.ts
(1 hunks)src/prompts/index.ts
(2 hunks)src/prompts/processors/prompty.ts
(1 hunks)test/prompts/constants.test.ts
(1 hunks)test/prompts/index.test.ts
(4 hunks)test/prompts/processors/prompty.test.ts
(1 hunks)test/prompts/utils.test.ts
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
`**/*.{ts,tsx}`: Use TypeScript with strict type checking.
**/*.{ts,tsx}
: Use TypeScript with strict type checking.
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
src/prompts/constants.ts
test/prompts/constants.test.ts
test/prompts/utils.test.ts
src/prompts/index.ts
test/prompts/processors/prompty.test.ts
src/prompts/processors/prompty.ts
test/prompts/index.test.ts
`**/*.{js,jsx,ts,tsx}`: Follow established import order with @trivago/prettier-p...
**/*.{js,jsx,ts,tsx}
: Follow established import order with @trivago/prettier-plugin-sort-imports.
Use consistent curly braces for all control statements.
Prefer const over let; avoid var.
Use object shorthand syntax whenever possible.
Use async/await for asynchronous code.
Use consistent error handling with proper type checks.
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
src/prompts/constants.ts
test/prompts/constants.test.ts
test/prompts/utils.test.ts
src/prompts/index.ts
test/prompts/processors/prompty.test.ts
src/prompts/processors/prompty.ts
test/prompts/index.test.ts
`**/*.{ts,tsx}`: Prefer not to introduce new TypeScript types; use existing interfaces whenever possible
**/*.{ts,tsx}
: Prefer not to introduce new TypeScript types; use existing interfaces whenever possible
📄 Source: CodeRabbit Inference Engine (.cursor/rules/gh-cli-workflow.mdc)
List of files the instruction was applied to:
src/prompts/constants.ts
test/prompts/constants.test.ts
test/prompts/utils.test.ts
src/prompts/index.ts
test/prompts/processors/prompty.test.ts
src/prompts/processors/prompty.ts
test/prompts/index.test.ts
`test/**/*.{test,spec}.{js,jsx,ts,tsx}`: Follow Jest best practices with describe/it blocks.
test/**/*.{test,spec}.{js,jsx,ts,tsx}
: Follow Jest best practices with describe/it blocks.
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
test/prompts/constants.test.ts
test/prompts/utils.test.ts
test/prompts/processors/prompty.test.ts
test/prompts/index.test.ts
`**/*.{test,spec}.{js,ts,tsx}`: Avoid disabling or skipping tests unless absolutely necessary and documented
**/*.{test,spec}.{js,ts,tsx}
: Avoid disabling or skipping tests unless absolutely necessary and documented
📄 Source: CodeRabbit Inference Engine (.cursor/rules/gh-cli-workflow.mdc)
List of files the instruction was applied to:
test/prompts/constants.test.ts
test/prompts/utils.test.ts
test/prompts/processors/prompty.test.ts
test/prompts/index.test.ts
`test/**/*.{test,spec}.ts`: Mock as few functions as possible to keep tests real...
test/**/*.{test,spec}.ts
: Mock as few functions as possible to keep tests realistic
Never increase the function timeout - fix the test instead
Organize tests in descriptivedescribe
andit
blocks
When writing expectations, prefer assertions on entire objects rather than individual keys
Clean up after tests to prevent side effects (e.g., use afterEach(() => { jest.resetAllMocks(); }))
Run tests with--randomize
flag to ensure your mocks setup and teardown don't affect other tests
Use Jest's mocking utilities rather than complex custom mocks
Prefer shallow mocking over deep mocking
Mock external dependencies but not the code being tested
Reset mocks between tests to prevent test pollution
For database tests, use in-memory instances or proper test fixtures
Test both success and error cases for each provider
Mock API responses to avoid external dependencies in tests
Validate that provider options are properly passed to the underlying service
Test error handling and edge cases (rate limits, timeouts, etc.)
Ensure provider caching behaves as expected
Always include both--coverage
and--randomize
flags when running tests
Run tests in a single pass (no watch mode for CI)
Ensure all tests are independent and can run in any order
Clean up any test data or mocks after each test
📄 Source: CodeRabbit Inference Engine (.cursor/rules/jest.mdc)
List of files the instruction was applied to:
test/prompts/constants.test.ts
test/prompts/utils.test.ts
test/prompts/processors/prompty.test.ts
test/prompts/index.test.ts
`examples/**/*`: Structure examples consistently with common patterns across the...
examples/**/*
: Structure examples consistently with common patterns across the project
Ensure all examples are functional and up-to-date
Keep examples as simple as possible while still demonstrating the concept
Follow the same code style guidelines as the main project in all example code and configuration
Include comments to explain non-obvious parts in example code and configuration
Use descriptive variable and function names in example code and configuration
Keep code DRY within reason; examples may duplicate code for clarity
📄 Source: CodeRabbit Inference Engine (.cursor/rules/examples.mdc)
List of files the instruction was applied to:
examples/prompty-basic/env_example.prompty
examples/prompty-advanced/promptfooconfig.yaml
examples/prompty-basic/completion_example.prompty
examples/prompty-basic/technical_support.prompty
examples/prompty-advanced/image_analysis.prompty
examples/prompty-basic/customer_service.prompty
examples/prompty-basic/promptfooconfig.yaml
examples/prompty-advanced/azure_chatbot.prompty
examples/prompty-advanced/README.md
examples/prompty-basic/README.md
`examples/*/promptfooconfig.yaml`: Include a working 'promptfooconfig.yaml' (or ...
examples/*/promptfooconfig.yaml
: Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Ensure all configuration files pass YAML lint validation
When referencing external files in configuration, always use the 'file://' prefix
For trivial test cases, make them quirky and fun to increase engagement
Always use the latest model versions available in 2025 for model selection in examples
Include a mix of providers when comparing model performance in examples
When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Include placeholder values for secrets/credentials in configuration files
Format configuration files consistently
Always use the latest available model versions for each provider in configuration files
Update model versions when new ones become available in configuration files
📄 Source: CodeRabbit Inference Engine (.cursor/rules/examples.mdc)
List of files the instruction was applied to:
examples/prompty-advanced/promptfooconfig.yaml
examples/prompty-basic/promptfooconfig.yaml
`site/{docs,blog,src/pages}/**/*.{md,mdx}`: Prioritize minimal edits when updati...
site/{docs,blog,src/pages}/**/*.{md,mdx}
: Prioritize minimal edits when updating existing documentation; avoid creating entirely new sections or rewriting substantial portions; focus edits on improving grammar, spelling, clarity, fixing typos, and structural improvements where needed; do not modify existing headings (h1, h2, h3, etc.) as they are often linked externally
Structure content to reveal information progressively: begin with essential actions and information, then provide deeper context as necessary; organize information from most important to least important
Use action-oriented language: clearly outline actionable steps, use concise and direct language, prefer active voice over passive voice, and use imperative mood for instructions
Use 'eval' instead of 'evaluation' in all documentation; when referring to command line usage, use 'npx promptfoo eval' rather than 'npx promptfoo evaluation'; maintain consistency with this terminology across all examples, code blocks, and explanations
Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Each markdown documentation page must include required front matter fields: 'title' (page title) and 'description' (concise summary, ideally 150-160 characters)
Optional front matter fields for markdown documentation pages: 'image', 'keywords', and 'sidebar_position' can be included to enhance SEO and navigation
Keep titles under 60 characters for optimal display in search results; write description meta tags between 150-160 characters; include relevant keywords naturally in both title and description; use unique titles and descriptions for each page; for image thumbnails, use 1200×630 pixels for optimal social media display
Only add a title attribute to code blocks that represent complete, runnable files; do not add titles to code fragments, partial examples, or snippets that aren't meant to be used as standalone files; applies to all code blocks regardless of language
Use special comment directives to highlight specific lines in code blocks: 'highlight-next-line', 'highlight-start'/'highlight-end', or line numbers in curly braces; never remove existing highlight directives when editing a document; preserve the original author's intent by maintaining their highlighting
Always specify the language for syntax highlighting in code blocks; use meaningful titles for code blocks when appropriate; keep code examples concise and focused; ensure code examples are correct and up-to-date; include comments in code examples where helpful
Use Docusaurus admonitions (note, tip, info, warning, danger) by wrapping content with three colons ':::' followed by the type; always include empty lines before and after the content inside admonitions, especially when using Prettier; you can include Markdown formatting within admonitions
When using Prettier to format Markdown files, always include empty lines around admonition content to prevent Prettier from reformatting admonitions to invalid syntax
Search the codebase to provide accurate and relevant backlinks within the documentation; include references to specific files, functions, or concepts; ensure backlinks are relevant to the current section
End each documentation section with a concise 'See Also' or 'Related Concepts' heading; link to related documentation or concepts; format the 'See Also' section consistently as a markdown list of links
Use clear, concise language; maintain a consistent tone throughout the documentation; write for an international audience (avoid idioms, colloquialisms, and culturally specific references); spell out acronyms on first use, followed by the acronym in parentheses
Include practical examples where appropriate; make examples realistic and applicable to common use cases; when showing configuration examples, include all necessary fields; demonstrate both basic and advanced usage when relevant
Use diagrams, screenshots, or illustrations to explain complex concepts; ensure images have appropriate alt text for accessibility; maintain a consistent visual style across all documentation; optimize images for web display
📄 Source: CodeRabbit Inference Engine (.cursor/rules/docusaurus.mdc)
List of files the instruction was applied to:
site/docs/configuration/prompts.md
`examples/*/README.md`: The README.md must begin with the folder name as an H1 h...
examples/*/README.md
: The README.md must begin with the folder name as an H1 heading
Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
Include a comprehensive README.md that explains the purpose, prerequisites, instructions, and expected outputs for each example
Document any model-specific capabilities or limitations in example README files
Clearly list all required environment variables at the beginning of the README
For each environment variable, explain its purpose, how to obtain it, and any default values or constraints in the README
Include a sample '.env' file or instructions when multiple environment variables are needed
Document any required API keys or credentials in the README
Provide instructions for cleaning up resources after running the example in the README
When creating examples for specific providers, explain any provider-specific configuration in the README
Document required environment variables for provider-specific examples in the README
Include information about pricing or usage limits for provider-specific examples in the README
Highlight unique features or capabilities of providers in the README
Compare to similar providers where appropriate in the README
Make it clear which features each example demonstrates in the README
Include links to more comprehensive documentation where appropriate in the README
📄 Source: CodeRabbit Inference Engine (.cursor/rules/examples.mdc)
List of files the instruction was applied to:
examples/prompty-advanced/README.md
examples/prompty-basic/README.md
🧠 Learnings (21)
📓 Common learnings
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/gh-cli-workflow.mdc:0-0
Timestamp: 2025-06-30T13:44:03.663Z
Learning: Use the Conventional Commits format in your commit messages (e.g., feat: add new provider)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/gh-cli-workflow.mdc:0-0
Timestamp: 2025-06-30T13:44:03.663Z
Learning: PR titles must follow Conventional Commits syntax (feat:, fix:, docs:, etc.)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'eval' instead of 'evaluation' in all documentation; when referring to command line usage, use 'npx promptfoo eval' rather than 'npx promptfoo evaluation'; maintain consistency with this terminology across all examples, code blocks, and explanations
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
.gitignore (10)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Ensure all configuration files pass YAML lint validation
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
src/prompts/constants.ts (2)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
test/prompts/constants.test.ts (11)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test error handling and edge cases (rate limits, timeouts, etc.)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Validate that provider options are properly passed to the underlying service
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/gh-cli-workflow.mdc:0-0
Timestamp: 2025-06-30T13:44:03.663Z
Learning: Applies to **/*.{test,spec}.{js,ts,tsx} : Avoid disabling or skipping tests unless absolutely necessary and documented
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test both success and error cases for each provider
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Never increase the function timeout - fix the test instead
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Ensure all tests are independent and can run in any order
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Ensure provider caching behaves as expected
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : When writing expectations, prefer assertions on entire objects rather than individual keys
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Organize tests in descriptive `describe` and `it` blocks
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to test/**/*.{test,spec}.{js,jsx,ts,tsx} : Follow Jest best practices with describe/it blocks.
examples/prompty-basic/env_example.prompty (11)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Include a sample '.env' file or instructions when multiple environment variables are needed
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : For each environment variable, explain its purpose, how to obtain it, and any default values or constraints in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Document required environment variables for provider-specific examples in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Clearly list all required environment variables at the beginning of the README
examples/prompty-advanced/promptfooconfig.yaml (11)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest available model versions for each provider in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
package.json (4)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Node.js version requirement (>=18.0.0).
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/{requirements.txt,package.json} : Keep dependencies updated in example requirements files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Update examples when APIs or dependencies change
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Use CommonJS modules (type: "commonjs" in package.json).
test/prompts/utils.test.ts (8)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test error handling and edge cases (rate limits, timeouts, etc.)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test both success and error cases for each provider
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/gh-cli-workflow.mdc:0-0
Timestamp: 2025-06-30T13:44:03.663Z
Learning: Applies to **/*.{test,spec}.{js,ts,tsx} : Avoid disabling or skipping tests unless absolutely necessary and documented
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Never increase the function timeout - fix the test instead
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to test/**/*.{test,spec}.{js,jsx,ts,tsx} : Follow Jest best practices with describe/it blocks.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Organize tests in descriptive `describe` and `it` blocks
examples/prompty-basic/completion_example.prompty (6)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest model versions available in 2025 for model selection in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
examples/prompty-basic/technical_support.prompty (5)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
src/prompts/index.ts (5)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use async/await for asynchronous code.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: When developing or testing examples locally, use 'npm run local' commands instead of 'npx promptfoo@latest' to ensure local changes are tested
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'eval' instead of 'evaluation' in all documentation; when referring to command line usage, use 'npx promptfoo eval' rather than 'npx promptfoo evaluation'; maintain consistency with this terminology across all examples, code blocks, and explanations
examples/prompty-advanced/image_analysis.prompty (4)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest model versions available in 2025 for model selection in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
examples/prompty-basic/customer_service.prompty (8)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest model versions available in 2025 for model selection in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest available model versions for each provider in configuration files
examples/prompty-basic/promptfooconfig.yaml (13)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Ensure all configuration files pass YAML lint validation
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
site/docs/configuration/prompts.md (14)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Prioritize minimal edits when updating existing documentation; avoid creating entirely new sections or rewriting substantial portions; focus edits on improving grammar, spelling, clarity, fixing typos, and structural improvements where needed; do not modify existing headings (h1, h2, h3, etc.) as they are often linked externally
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'eval' instead of 'evaluation' in all documentation; when referring to command line usage, use 'npx promptfoo eval' rather than 'npx promptfoo evaluation'; maintain consistency with this terminology across all examples, code blocks, and explanations
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
examples/prompty-advanced/azure_chatbot.prompty (9)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Update model versions when new ones become available in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest model versions available in 2025 for model selection in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always use the latest available model versions for each provider in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
examples/prompty-advanced/README.md (17)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Make it clear which features each example demonstrates in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Include links to more comprehensive documentation where appropriate in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Include a comprehensive README.md that explains the purpose, prerequisites, instructions, and expected outputs for each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Highlight unique features or capabilities of providers in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Document any model-specific capabilities or limitations in example README files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : When creating examples for specific providers, explain any provider-specific configuration in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
test/prompts/processors/prompty.test.ts (14)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test error handling and edge cases (rate limits, timeouts, etc.)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Mock as few functions as possible to keep tests realistic
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Run tests with `--randomize` flag to ensure your mocks setup and teardown don't affect other tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Mock API responses to avoid external dependencies in tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Organize tests in descriptive `describe` and `it` blocks
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test both success and error cases for each provider
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Clean up after tests to prevent side effects (e.g., use afterEach(() => { jest.resetAllMocks(); }))
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Ensure all tests are independent and can run in any order
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to test/**/*.{test,spec}.{js,jsx,ts,tsx} : Follow Jest best practices with describe/it blocks.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Validate that provider options are properly passed to the underlying service
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Use Jest's mocking utilities rather than complex custom mocks
src/prompts/processors/prompty.ts (5)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use async/await for asynchronous code.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'eval' instead of 'evaluation' in all documentation; when referring to command line usage, use 'npx promptfoo eval' rather than 'npx promptfoo evaluation'; maintain consistency with this terminology across all examples, code blocks, and explanations
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When implementing custom providers, prompts, or asserts in Python for the promptfoo project, follow the established API patterns to ensure compatibility and maintainability.
examples/prompty-basic/README.md (15)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Include a comprehensive README.md that explains the purpose, prerequisites, instructions, and expected outputs for each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Make it clear which features each example demonstrates in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Include links to more comprehensive documentation where appropriate in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Format configuration files consistently
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Document any model-specific capabilities or limitations in example README files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Document any required API keys or credentials in the README
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : When demonstrating specialized capabilities (vision, audio, etc.), use models that support those features
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a mix of providers when comparing model performance in examples
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include placeholder values for secrets/credentials in configuration files
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Always include the YAML schema reference at the top of configuration files: '# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json'
test/prompts/index.test.ts (21)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : For trivial test cases, make them quirky and fun to increase engagement
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/docusaurus.mdc:0-0
Timestamp: 2025-06-30T13:43:26.694Z
Learning: Applies to site/{docs,blog,src/pages}/**/*.{md,mdx} : Use 'Promptfoo' (capitalized) at the beginning of sentences or in headings, and 'promptfoo' (lowercase) in code examples, terminal commands, or when referring to the package name; be consistent with the chosen capitalization within each document or section
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test error handling and edge cases (rate limits, timeouts, etc.)
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: When developing or testing examples locally, use 'npm run local' commands instead of 'npx promptfoo@latest' to ensure local changes are tested
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Use Jest's mocking utilities rather than complex custom mocks
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Mock API responses to avoid external dependencies in tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Mock external dependencies but not the code being tested
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/python.mdc:0-0
Timestamp: 2025-06-23T12:49:38.363Z
Learning: When integrating Python components with the TypeScript core of the promptfoo project, follow the patterns established in existing Python files for seamless interfacing.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Include a working 'promptfooconfig.yaml' (or equivalent) file in each example
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Mock as few functions as possible to keep tests realistic
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use async/await for asynchronous code.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Use CommonJS modules (type: "commonjs" in package.json).
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/README.md : Every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Clean up after tests to prevent side effects (e.g., use afterEach(() => { jest.resetAllMocks(); }))
Learnt from: CR
PR: promptfoo/promptfoo#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T13:43:03.656Z
Learning: Applies to test/**/*.{test,spec}.{js,jsx,ts,tsx} : Follow Jest best practices with describe/it blocks.
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Reset mocks between tests to prevent test pollution
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Test both success and error cases for each provider
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Ensure provider caching behaves as expected
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Validate that provider options are properly passed to the underlying service
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/examples.mdc:0-0
Timestamp: 2025-06-30T13:43:50.317Z
Learning: Applies to examples/*/promptfooconfig.yaml : Follow the specified field order in all configuration files: description, env (optional), prompts, providers, defaultTest (optional), scenarios (optional), tests
Learnt from: CR
PR: promptfoo/promptfoo#0
File: .cursor/rules/jest.mdc:0-0
Timestamp: 2025-06-30T13:44:19.019Z
Learning: Applies to test/**/*.{test,spec}.ts : Organize tests in descriptive `describe` and `it` blocks
🧬 Code Graph Analysis (5)
test/prompts/constants.test.ts (1)
src/prompts/constants.ts (1)
VALID_FILE_EXTENSIONS
(4-20)
src/prompts/index.ts (1)
src/prompts/processors/prompty.ts (1)
processPromptyFile
(237-332)
test/prompts/processors/prompty.test.ts (1)
src/prompts/processors/prompty.ts (1)
processPromptyFile
(237-332)
src/prompts/processors/prompty.ts (3)
src/logger.ts (1)
logger
(191-203)examples/redteam-dalle/save.js (2)
match
(23-23)imageUrl
(24-24)src/util/index.ts (1)
renderVarsInObject
(266-289)
test/prompts/index.test.ts (2)
src/prompts/processors/prompty.ts (1)
processPromptyFile
(237-332)src/prompts/index.ts (2)
readPrompts
(189-204)processPrompts
(206-235)
🪛 LanguageTool
examples/prompty-advanced/README.md
[grammar] ~1-~1: Ensure spelling is correct
Context: # prompty-advanced This example demonstrates adv...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~3-~3: Ensure spelling is correct
Context: ...nstrates advanced features of Microsoft Prompty files in promptfoo. ## Advanced Featur...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
examples/prompty-basic/README.md
[grammar] ~3-~3: Ensure spelling is correct
Context: ...ample demonstrates how to use Microsoft Prompty files with promptfoo for LLM evaluation...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
[grammar] ~53-~53: Ensure spelling is correct
Context: ...### Variable substitution Variables in prompty files use double curly braces: `{{varia...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🪛 markdownlint-cli2 (0.17.2)
examples/prompty-advanced/README.md
31-31: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
41-41: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
49-49: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 Biome (1.9.4)
test/prompts/processors/prompty.test.ts
[error] 346-346: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
[error] 347-347: Avoid the delete operator which can impact performance.
Unsafe fix: Use an undefined assignment instead.
(lint/performance/noDelete)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
- GitHub Check: Cursor BugBot
- GitHub Check: Build Docs
- GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (21)
.gitignore (1)
38-38
: LGTM - Appropriate gitignore addition.The addition of
prompty/
to ignore the prompty directory is appropriate given the new .prompty file support being introduced in this PR.test/prompts/constants.test.ts (1)
17-19
: LGTM - Test coverage for .prompty extension.The test correctly verifies that
.prompty
is included in the valid file extensions array, following the established testing pattern.package.json (1)
229-232
: LGTM - Dependencies aligned with .prompty support.The new dependencies are appropriate for the .prompty file format support:
gray-matter
: For parsing YAML frontmatter in .prompty filesgroq-sdk
: For Groq provider integrationhpagent
andhttp-proxy-agent
: For HTTP proxy supportAll dependencies have proper version constraints.
src/prompts/constants.ts (1)
14-14
: LGTM - Extension addition maintains alphabetical order.The addition of
.prompty
to the valid file extensions array is correctly placed in alphabetical order and enables the system to recognize .prompty files as valid prompt definitions.test/prompts/utils.test.ts (1)
122-127
: LGTM - Comprehensive test coverage for .prompty files.The test thoroughly covers various .prompty file path scenarios including plain filenames, file URIs, absolute paths, and function suffixes. This ensures the
maybeFilePath
function correctly identifies .prompty files as valid file paths.src/prompts/index.ts (2)
22-22
: LGTM - Clean import integration.The import follows the established pattern and is properly positioned with other processor imports.
168-170
: LGTM - Consistent file type handling.The
.prompty
file handling follows the same conditional pattern used for other file types and correctly passes the required parameters.examples/prompty-basic/env_example.prompty (1)
1-21
: LGTM - Well-structured environment variable example.The Prompty file demonstrates proper:
- YAML frontmatter structure
- Environment variable usage with
${env:OPENAI_API_KEY}
syntax- Sample data configuration
- System and user message templates
examples/prompty-basic/completion_example.prompty (1)
1-16
: LGTM - Excellent completion API example.The Prompty file demonstrates proper:
- Completion API configuration
- Model parameters with appropriate settings
- Stop sequences for completion control
- Sample data for testing
- Clean story completion template
examples/prompty-basic/customer_service.prompty (1)
1-31
: LGTM - Comprehensive customer service example.The Prompty file demonstrates excellent:
- Complete metadata with authors and tags
- Proper chat API configuration
- Well-structured system instructions with clear role definition
- Dynamic variable templating for customer interactions
- Appropriate model parameters for customer service use case
examples/prompty-basic/promptfooconfig.yaml (1)
3-10
: LGTM! Proper prompts and provider configuration.The prompts section correctly references multiple
.prompty
files, and the echo provider is appropriate for testing without requiring API keys.examples/prompty-advanced/image_analysis.prompty (1)
15-27
: Excellent image analysis prompt structure.The system prompt provides comprehensive guidance for image analysis, and the user prompt correctly uses markdown syntax for image embedding with variable substitution.
examples/prompty-basic/technical_support.prompty (1)
1-30
: Well-structured technical support prompt.The Prompty file effectively demonstrates:
- Proper YAML frontmatter with metadata
- Appropriate model configuration for technical support
- Clear system instructions with specific guidelines
- Good use of variable templating for product, error, and platform
The prompt structure follows best practices for technical support interactions.
examples/prompty-advanced/README.md (1)
1-119
: Comprehensive and well-structured documentation.The README provides excellent coverage of:
- Advanced Prompty features
- Azure OpenAI configuration
- Vision/image support
- Detailed templating examples
- Environment variable usage
- Links to external documentation
The documentation effectively demonstrates the capabilities of the new Prompty format.
examples/prompty-advanced/azure_chatbot.prompty (2)
31-52
: Excellent multi-turn conversation implementation.The prompt effectively demonstrates:
- Multi-turn conversation flow with system, user, and assistant messages
- Conditional logic using Nunjucks templating
- Proper variable substitution for personalization
- Educational context with difficulty-level adaptation
The implementation showcases advanced Prompty features very well.
11-25
: Comprehensive Azure OpenAI configuration.The model configuration properly demonstrates:
- Azure-specific settings (endpoint, deployment, API version)
- Environment variable usage for secrets
- Appropriate model parameters for conversational AI
- Response format specification
This serves as a good example for Azure OpenAI integration.
test/prompts/index.test.ts (2)
6-6
: LGTM! Well-structured tests for .prompty file supportThe new tests properly mock
processPromptyFile
and test both single file and glob pattern scenarios. The test structure follows Jest best practices with proper cleanup.Also applies to: 50-50, 625-665
983-1007
: LGTM! Good integration test for prompty processingThis test effectively validates that prompty files are correctly processed through the main
processPrompts
function, including parsing of YAML frontmatter into chat messages.site/docs/configuration/prompts.md (1)
270-430
: LGTM! Comprehensive documentation for the new Prompty featureThe new section thoroughly documents Microsoft Prompty file support with clear examples, proper formatting, and correct terminology usage. The documentation follows the style guidelines and provides valuable information for users adopting this new feature.
test/prompts/processors/prompty.test.ts (1)
8-413
: LGTM! Comprehensive test coverage for Prompty file processingExcellent test suite covering all major features:
- Chat and completion API modes
- Role parsing with various formats
- Image support in messages
- Model configuration mapping (Azure OpenAI, OpenAI)
- Environment variable resolution
- Sample data and function generation
- Error handling
- Multi-turn conversations
The tests are well-organized and follow Jest best practices.
src/prompts/processors/prompty.ts (1)
1-332
: LGTM! Well-structured implementation of Prompty file supportThe implementation is comprehensive and handles all the documented features:
- Clean separation of concerns with helper functions
- Proper TypeScript interfaces
- Good error handling and logging
- Support for multiple provider configurations
- Environment variable resolution with warnings
- Template rendering with sample data
Excellent work on this feature implementation!
configuration: | ||
type: openai | ||
api_key: ${env:OPENAI_API_KEY} | ||
model: gpt-3.5-turbo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify that the model version is the latest available for 2025.
The example uses gpt-3.5-turbo
which may not be the latest model version. According to the coding guidelines, examples should use the latest model versions available in 2025.
🌐 Web query:
What is the latest OpenAI GPT-3.5-turbo model version available in 2025?
💡 Result:
As of July 2025, OpenAI's GPT-3.5-turbo model has evolved to include several versions, each offering enhanced capabilities:
-
gpt-3.5-turbo-0613: Introduced in June 2023, this version added function calling and improved steerability via system messages. (openai.com)
-
gpt-3.5-turbo-1106: Released in November 2023, it expanded the context window to 16,000 tokens, allowing for processing of approximately 20 pages of text in a single request. (openai.com)
-
gpt-3.5-turbo-0125: Launched in January 2025, this version featured reduced pricing and higher accuracy in responding to requested formats. (openai.com)
In July 2024, OpenAI introduced GPT-4o mini, a more advanced and cost-effective model that replaced GPT-3.5-turbo on the ChatGPT interface. GPT-4o mini offers enhanced capabilities, including multimodal processing and a larger context window, making it a suitable alternative for many applications. (en.wikipedia.org)
Given these advancements, GPT-4o mini is recommended for users seeking the latest features and improved performance.
Citations:
- 1: https://openai.com/index/function-calling-and-other-api-updates/?utm_source=openai
- 2: https://openai.com/index/function-calling-and-other-api-updates/?utm_source=openai
- 3: https://openai.com/index/new-embedding-models-and-api-updates/?utm_source=openai
- 4: https://en.wikipedia.org/wiki/GPT-4o?utm_source=openai
Update example to the latest GPT-3.5 model version
Replace the generic gpt-3.5-turbo
label with the January 2025 release gpt-3.5-turbo-0125
in your Prompty example.
• File: examples/prompty-basic/env_example.prompty
Line 10
- model: gpt-3.5-turbo
+ model: gpt-3.5-turbo-0125
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
model: gpt-3.5-turbo | |
model: gpt-3.5-turbo-0125 |
🤖 Prompt for AI Agents
In examples/prompty-basic/env_example.prompty at line 10, update the model name
from the generic "gpt-3.5-turbo" to the latest January 2025 release
"gpt-3.5-turbo-0125" to reflect the current version in the example.
api: completion | ||
configuration: | ||
type: openai | ||
name: gpt-3.5-turbo-instruct |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify that the completion model version is the latest available.
The example uses gpt-3.5-turbo-instruct
for completion API. Please verify this is still the latest completion model available in 2025.
🌐 Web query:
What is the latest OpenAI completion model available in 2025?
💡 Result:
As of July 9, 2025, OpenAI's latest language model is GPT-4.5, released on February 27, 2025. GPT-4.5 is OpenAI's largest model to date, designed to improve pattern recognition and connection drawing. It is available to users subscribed to the ChatGPT Plus and Pro plans across web, mobile, and desktop platforms. Access is also provided through the OpenAI API and the OpenAI Developer Playground, but the company plans to phase out API access to the model in July. (en.wikipedia.org)
OpenAI has announced plans for GPT-5, expected to be released in the summer of 2025. GPT-5 is anticipated to bring significant upgrades, including enhanced reasoning and planning capabilities, improved personalization, increased context length, and advancements in image and video generation. However, as of now, GPT-5 has not been released. (tomsguide.com)
OpenAI's Upcoming GPT-5 Release and Developments:
- GPT-5 will be here any minute - here's what we're hoping to see
- OpenAI debuts GPT-4.5, its biggest model yet
- ChatGPT-5 is on hold as OpenAI changes plans and releases new o3 and o4-mini models
Citations:
- 1: https://en.wikipedia.org/wiki/GPT-4.5?utm_source=openai
- 2: https://www.tomsguide.com/ai/gpt-5-could-be-here-this-month-heres-five-features-were-hoping-to-see?utm_source=openai
- 3: https://www.tomsguide.com/ai/gpt-5-could-be-here-this-month-heres-five-features-were-hoping-to-see?utm_source=openai
- 4: https://www.axios.com/2025/02/27/chatgpt-45-model-openai-reasoning?utm_source=openai
- 5: https://www.techradar.com/computing/artificial-intelligence/chatgpt-5-is-on-hold-as-openai-changes-plans-and-releases-new-o3-and-o4-mini-models?utm_source=openai
Replace gpt-3.5-turbo-instruct
with GPT-4.5
OpenAI released GPT-4.5 on February 27, 2025, as its newest model. Please update this example to use the latest completion model.
• examples/prompty-basic/completion_example.prompty: line 8
- name: gpt-3.5-turbo-instruct
+ name: gpt-4.5
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
name: gpt-3.5-turbo-instruct | |
name: gpt-4.5 |
🤖 Prompt for AI Agents
In examples/prompty-basic/completion_example.prompty at line 8, replace the
model name 'gpt-3.5-turbo-instruct' with 'gpt-4.5' to update the example to use
the latest OpenAI completion model released on February 27, 2025.
api: chat | ||
configuration: | ||
type: openai | ||
name: gpt-3.5-turbo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify that the model version is the latest available for 2025.
The example uses gpt-3.5-turbo
which may not be the latest model version. According to the coding guidelines, examples should use the latest model versions available in 2025.
🌐 Web query:
What is the latest OpenAI GPT-3.5-turbo model version available in 2025?
💡 Result:
The latest OpenAI GPT-3.5-turbo model version available in 2025 is gpt-3.5-turbo-0125. This version supports a 16,385 token context window and offers improvements such as higher accuracy in responding in requested formats and a fix for a text encoding issue affecting non-English language function calls[1][3][7]. It is the most recent and generally available (GA) variant of GPT-3.5-turbo as of July 2025[7].
For reference, here are the main GPT-3.5-turbo variants and their status:
Model Version | Max Context (tokens) | Release/Status |
---|---|---|
gpt-3.5-turbo-0125 | 16,385 | Current main version, recommended by OpenAI |
gpt-3.5-turbo-1106 | 16,385 | Still available, older than 0125 |
gpt-3.5-turbo-instruct-0914 | 4,097 | For completions endpoint, not chat |
Older models—such as gpt-3.5-turbo-0613
and gpt-3.5-turbo-16k-0613
—have been deprecated and are no longer available to new users as of June 2024[4][5].
Note: OpenAI now recommends newer models like GPT-4o and the o-series for most use cases, as they offer improved performance and cost efficiency. However, GPT-3.5-turbo-0125 remains the latest and most capable GPT-3.5-turbo model available for those specifically requiring GPT-3.5[4][5][7].
Citations:
- 1: https://www.techtarget.com/searchenterpriseai/tip/GPT-35-vs-GPT-4-Biggest-differences-to-consider
- 2: https://openai.com/index/gpt-3-5-turbo-fine-tuning-and-api-updates/
- 3: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/whats-new
- 4: https://community.openai.com/t/is-gpt-3-5-turbo-16k-being-deprecated/932563
- 5: https://platform.openai.com/docs/deprecations/instructgpt-models
- 6: https://en.wikipedia.org/wiki/GPT-3
- 7: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/concepts/models
- 8: https://help.openai.com/en/articles/6825453-chatgpt-release-notes
- 9: https://llm-stats.com/models/compare/gpt-3.5-turbo-0125-vs-o3-pro-2025-06-10
- 10: https://community.openai.com/t/more-transparency-regarding-ai-version/1132813
Update to latest GPT-3.5-turbo-0125 in example
Per guidelines, examples must use the newest model versions available in 2025—gpt-3.5-turbo-0125
is the current GA variant.
• File: examples/prompty-basic/customer_service.prompty
Line 13:
- name: gpt-3.5-turbo
+ name: gpt-3.5-turbo-0125
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
name: gpt-3.5-turbo | |
name: gpt-3.5-turbo-0125 |
🤖 Prompt for AI Agents
In examples/prompty-basic/customer_service.prompty at line 13, update the model
name from "gpt-3.5-turbo" to the latest version "gpt-3.5-turbo-0125" to comply
with the 2025 guidelines requiring use of the newest available model versions.
@@ -0,0 +1,30 @@ | |||
description: Example of using Microsoft Prompty files with promptfoo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing required YAML schema reference.
According to the coding guidelines, all configuration files must include the YAML schema reference at the top.
Add this line at the very beginning of the file:
+# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json
description: Example of using Microsoft Prompty files with promptfoo
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
description: Example of using Microsoft Prompty files with promptfoo | |
# yaml-language-server: $schema=https://promptfoo.dev/config-schema.json | |
description: Example of using Microsoft Prompty files with promptfoo |
🤖 Prompt for AI Agents
In examples/prompty-basic/promptfooconfig.yaml at line 1, the file is missing
the required YAML schema reference at the top. Add the appropriate YAML schema
reference line as the very first line of the file to comply with coding
guidelines.
- vars: | ||
task: 'Create a motivational quote about learning' | ||
assert: | ||
- type: llm-rubric | ||
value: The completion should be creative and continue the sci-fi theme |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Test assertion doesn't match the provided variables.
The test variables include a task
about creating a "motivational quote about learning", but the assertion expects a "sci-fi theme" continuation. This mismatch will cause the test to fail.
Either update the assertion to match the motivational quote context or change the variables to match the sci-fi theme:
- vars:
- task: 'Create a motivational quote about learning'
+ beginning: 'In the year 2150, humanity discovered'
assert:
- type: llm-rubric
value: The completion should be creative and continue the sci-fi theme
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
- vars: | |
task: 'Create a motivational quote about learning' | |
assert: | |
- type: llm-rubric | |
value: The completion should be creative and continue the sci-fi theme | |
- vars: | |
beginning: 'In the year 2150, humanity discovered' | |
assert: | |
- type: llm-rubric | |
value: The completion should be creative and continue the sci-fi theme |
🤖 Prompt for AI Agents
In examples/prompty-basic/promptfooconfig.yaml around lines 26 to 30, the test
variables specify a task to create a motivational quote about learning, but the
assertion expects the completion to continue a sci-fi theme, causing a mismatch.
To fix this, either update the assertion's expected value to align with the
motivational quote context or modify the task variable to request a sci-fi
themed continuation so both match.
api: chat | ||
configuration: | ||
type: openai | ||
name: gpt-4-vision-preview |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Consider updating to the latest GPT-4 Vision model.
The gpt-4-vision-preview
model may be outdated for 2025. According to the coding guidelines, examples should use the latest available model versions.
Consider updating to the latest GPT-4 Vision model:
- name: gpt-4-vision-preview
+ name: gpt-4-turbo-vision
Please verify the latest GPT-4 Vision model name available in 2025:
🌐 Web query:
What is the latest GPT-4 Vision model available from OpenAI in 2025?
💡 Result:
The latest GPT-4 Vision (multimodal) model available from OpenAI in 2025 is the GPT-4.1 series, which includes three variants: GPT-4.1, GPT-4.1 mini, and GPT-4.1 nano. These models were released in April 2025 and are accessible via the OpenAI API[7][6].
GPT-4.1 builds on the capabilities of earlier GPT-4-based vision models (like GPT-4o and GPT-4 Turbo with Vision), offering:
- Major improvements in vision tasks—it surpasses previous models (including GPT-4o and GPT-4.5) on standard multimodal benchmarks such as MMMU and MathVista[7].
- API-only access—OpenAI provides GPT-4.1 for image and video processing tasks through its API, supporting broader context and stronger performance across visual understanding, coding, and long-context instruction following[7][6].
- Context window up to 1 million tokens, ideal for tasks requiring long-form visual and text context[6].
GPT-4.1 and its variants are currently the most advanced available publicly for multimodal (text + image) processing from OpenAI as of July 2025[7][6][8].
Citations:
- 1: https://en.wikipedia.org/wiki/GPT-4
- 2: https://research.aimultiple.com/gpt4/
- 3: https://blog.risingstack.com/state-of-openai-gpt-models/
- 4: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/whats-new
- 5: https://community.openai.com/t/am-i-using-the-latest-version-of-gpt-vision/715680
- 6: https://blog.roboflow.com/gpt-4-1-multimodal/
- 7: https://openai.com/index/gpt-4-1/
- 8: https://learn.microsoft.com/en-us/azure/ai-foundry/openai/concepts/models
- 9: https://openai.com/index/introducing-gpt-4-5/
- 10: https://platform.openai.com/docs/models
Update Vision model to GPT-4.1
The current gpt-4-vision-preview
model has been superseded by the GPT-4.1 series (released April 2025), which delivers significant improvements on multimodal benchmarks and supports up to 1 M token contexts.
• File: examples/prompty-advanced/image_analysis.prompty
• Line 8: model name
- name: gpt-4-vision-preview
+ name: gpt-4.1
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
name: gpt-4-vision-preview | |
name: gpt-4.1 |
🤖 Prompt for AI Agents
In examples/prompty-advanced/image_analysis.prompty at line 8, update the model
name from "gpt-4-vision-preview" to the new "gpt-4.1" series to reflect the
latest version with improved multimodal capabilities and extended token context
support.
examples/prompty-advanced/README.md
Outdated
## Running the examples | ||
|
||
1. Set up environment variables (if using Azure OpenAI): | ||
|
||
```bash | ||
export AZURE_OPENAI_ENDPOINT=your-endpoint | ||
export AZURE_OPENAI_API_KEY=your-key | ||
``` | ||
|
||
2. Run with the echo provider (no API key needed): | ||
|
||
```bash | ||
npx promptfoo eval | ||
``` | ||
|
||
3. Or run with actual providers: | ||
```bash | ||
npx promptfoo eval --providers openai:gpt-4 | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing required init command instructions.
According to the coding guidelines, every example README must include instructions on how to run it with npx promptfoo@latest init --example example-name
.
Add the init command instructions before the "Running the examples" section:
+## Quick Start
+
+To get started with this example:
+
+```bash
+npx promptfoo@latest init --example prompty-advanced
+```
+
## Running the examples
🤖 Prompt for AI Agents
In examples/prompty-advanced/README.md around lines 72 to 90, the README is
missing the required instructions to run the init command for the example. Add a
new section or a line before the "Running the examples" heading that shows how
to initialize the example using the command `npx promptfoo@latest init --example
prompty-advanced` enclosed in a bash code block. This ensures users know how to
properly set up the example before running it.
type: azure_openai | ||
azure_endpoint: ${env:AZURE_OPENAI_ENDPOINT} | ||
azure_deployment: gpt-4 | ||
api_version: 2024-02-01 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify Azure OpenAI API version for 2025.
The API version "2024-02-01" may be outdated for 2025. According to the coding guidelines, examples should use the latest available versions.
Please verify the latest Azure OpenAI API version available in 2025:
🌐 Web query:
What is the latest Azure OpenAI API version available in 2025?
💡 Result:
As of July 9, 2025, the latest Azure OpenAI API version is 2025-04-01-preview
. This version introduces several new features, including:
- GPT-image-1 Support: Enhances image generation capabilities.
- Reasoning Summaries: Provides summaries for
o3
ando4-mini
models. - Evaluation API: Introduces tools for model evaluation.
Additionally, Microsoft has announced a new approach to API version management, allowing developers to use latest
for stable features and preview
for cutting-edge capabilities without the need for monthly version updates. This change simplifies the development process and supports standard OpenAI client libraries with minimal code modifications. (devblogs.microsoft.com)
For more detailed information on the latest features and updates, you can refer to the official Azure OpenAI documentation. (learn.microsoft.com)
Citations:
- 1: https://devblogs.microsoft.com/foundry/whats-new-in-azure-ai-foundry-june-2025?utm_source=openai
- 2: https://learn.microsoft.com/en-us/azure/ai-services/openai/whats-new?utm_source=openai
Update Azure OpenAI API version to 2025-04-01-preview
The current API version (2024-02-01
) is outdated for 2025. Please update to the latest preview version to ensure compatibility with new features.
• examples/prompty-advanced/azure_chatbot.prompty (line 17)
Apply this patch:
- api_version: 2024-02-01
+ api_version: 2025-04-01-preview
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
api_version: 2024-02-01 | |
api_version: 2025-04-01-preview |
🤖 Prompt for AI Agents
In examples/prompty-advanced/azure_chatbot.prompty at line 17, update the Azure
OpenAI API version from "2024-02-01" to "2025-04-01-preview" to ensure
compatibility with the latest features. Replace the existing api_version value
with the new version string exactly as specified.
- **Environment variables**: Secure API key management using `${env:VAR_NAME}` syntax | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
List required environment variables at the beginning
The README should clearly list all required environment variables at the beginning, not just mention them in passing.
Add a new section after line 17:
- **Environment variables**: Secure API key management using `${env:VAR_NAME}` syntax
+## Required Environment Variables
+
+This example supports the following environment variables:
+
+- `OPENAI_API_KEY` - Your OpenAI API key (required for OpenAI provider examples)
+- `AZURE_OPENAI_API_KEY` - Your Azure OpenAI API key (required for Azure examples)
+- `AZURE_OPENAI_ENDPOINT` - Your Azure OpenAI endpoint URL (required for Azure examples)
+
+Set these variables in your environment or create a `.env` file in the project root.
+
## Template Engine
Also applies to: 67-76
🤖 Prompt for AI Agents
In examples/prompty-basic/README.md around lines 16 to 17 and also lines 67 to
76, the README currently only mentions environment variables in passing. Add a
dedicated section near the beginning of the README that clearly lists all
required environment variables with their descriptions. This section should be
placed immediately after line 17 and similarly updated around lines 67 to 76 to
improve clarity for users setting up the project.
## Running the example | ||
|
||
1. Make sure you have promptfoo installed: | ||
|
||
```bash | ||
npm install -g promptfoo | ||
``` | ||
|
||
2. Run the evaluation: | ||
|
||
```bash | ||
npx promptfoo eval | ||
``` | ||
|
||
3. View the results: | ||
```bash | ||
npx promptfoo view | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Add initialization instructions using npx promptfoo@latest init
According to the coding guidelines, every example README must include instructions on how to run it with 'npx promptfoo@latest init --example example-name'.
Add the following section after line 30:
## Running the example
+### Option 1: Initialize from template
+
+To create a new project based on this example:
+
+```bash
+npx promptfoo@latest init --example prompty-basic
+cd prompty-basic
+npx promptfoo eval
+```
+
+### Option 2: Run directly
+
1. Make sure you have promptfoo installed:
🤖 Prompt for AI Agents
In examples/prompty-basic/README.md around lines 30 to 48, the README lacks the
required initialization instructions using 'npx promptfoo@latest init'. Add a
new section after line 30 that includes the commands 'npx promptfoo@latest init
--example prompty-basic', 'cd prompty-basic', and 'npx promptfoo eval' to guide
users on initializing the example properly before running it.
- Remove unnecessary dependencies (groq-sdk, hpagent, http-proxy-agent) - Add YAML schema references to example config files - Fix test assertion to match provided variables - Update model versions to latest (gpt-3.5-turbo-0125, gpt-4-turbo) - Update Azure API version to 2025-04-01-preview - Add Quick Start sections with init instructions to READMEs - Add required environment variables documentation - Add language specifications to code blocks - Improve image URL regex to handle parentheses - Use undefined assignment instead of delete for env vars in tests
- Updated OpenAI models to o3-mini and gpt-4o-mini - Added model configuration to technical_support.prompty - Added comments in config files showing latest model options - Updated Azure deployment to use gpt-4o-mini - Shortened description field to comply with guidelines (3-10 words)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Test Environment Variable Cleanup Error
Environment variables are incorrectly cleaned up in tests by assigning undefined as unknown as string
. This sets the variable to the string "undefined" instead of truly unsetting it, leading to test pollution. The correct approach is to use delete process.env.VAR_NAME
.
test/prompts/processors/prompty.test.ts#L345-L347
promptfoo/test/prompts/processors/prompty.test.ts
Lines 345 to 347 in fb6bdd8
// Clean up | |
process.env.TEST_API_KEY = undefined as unknown as string; | |
process.env.TEST_ENDPOINT = undefined as unknown as string; |
Was this report helpful? Give feedback by reacting with 👍 or 👎
Summary
This PR adds comprehensive support for Microsoft's Prompty file format (
.prompty
files), enabling users to define prompts with metadata, model configuration, and content in a single file.Features
Core Functionality
${env:VAR_NAME}
syntaxProvider Configuration Mapping
Examples Included
Documentation
site/docs/configuration/prompts.md
Testing
Implementation Notes
process.env
Breaking Changes
None. This is a new feature that doesn't affect existing functionality.
Checklist