Comments (3)
Sorry, it looks like the issue in model-graded-closedqa
is somewhere else. It looks like it might be failing to properly double-escape the original prompt when including it in the LLM message.
I'm getting this:
Error: Chat Completion prompt is not a valid JSON string: SyntaxError: Expected ',' or '}' after property value in JSON at position 751
The snippet around position 751 is:
The merge request is titled \\"add scala
Position 751 is the quote, so there's definitely an issue with not properly double-quoting a quote. I'm guessing it should be
\\\"
from promptfoo.
Hey @iamjackg, thanks for the report. Definitely seems like something is going wrong with escaping.
promptfoo does double-escape the original prompt when including it: https://github.com/promptfoo/promptfoo/blob/main/src/matchers.ts#L311-L313
So I would guess that the string may have already escaped when it got there. As a temporary workaround, you can remove the nested escaped string (or use single quotes).
from promptfoo.
Probable fix landed in #242
from promptfoo.
Related Issues (20)
- Expose all assertions for jest integration HOT 2
- When the evaluation of "npx promptfoo@latest" fails, the process exit code is still 0 HOT 1
- Using external python assertion on Mac faced Bad escaped character when vars with double quote HOT 2
- Security threat. /bin/sh: 1: Syntax error due to improper character handling HOT 3
- FR: Ollama Chat API HOT 2
- Question: Is it possible to take an external LLM response(output) and promptfoo just runs the metrics on the output? HOT 4
- Prompfoo giving false-positives? HOT 3
- Bedrock model identifier for Claude 2.1 is `anthropic.claude-v2:1`; Code splits : so it hits v2 HOT 2
- Adding AZURE_OPENAI_API_KEY in the config.yaml file. Is it possible? HOT 2
- Does the provider support loading from files? HOT 1
- Add provider for Together AI HOT 2
- Python assert do not work HOT 5
- HF Text Generation Inference Response Parsing Issue HOT 2
- Loading multi prompt with config set in command line doesn't work HOT 3
- Using `repeat` with cache does not work as expected HOT 3
- Specifying multiple __expected column would test only one of them HOT 2
- Cannot test complex tools that use $refs and $defs HOT 3
- Stop sequence validation error for `gpt-4-vision-preview` HOT 2
- model-graded-factuality and model-graded-closedqa asserts using AzureOpenAI HOT 2
- Question: What models actually support the perplexity metric? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from promptfoo.