Comments (3)
There isn't a way to suppress the warning, but I noticed something strange about your prompt. Are you intentionally including the literal string "\n"
? If not you probably should use literal newlines (this stackoverflow post is useful). Incidentally that will prevent the "maybe filepath" trigger that is causing the output you want to hide.
from promptfoo.
Yeah actually I did also observe that the \n
was involved with the warning showing up or not showing up. Though I chose to ignore this seeming edge case in the warning not appearing because I liked when the warning didn't occur 😆.
Also in #729 we observed \n
doesn't really play nice with JSON conversions, so actually I removed the \n
from my prompt in favor of actual whitespace lines.
Feel free to use this issue as an opportunity to:
- Resolve the edge case where the warning doesn't occur, when perhaps it should
- Create a way to suppress this warning
Or just close this one out, as you stated there's not a way to suppress the warning 👍
from promptfoo.
This warning is indeed a bit troublesome.
My situation is that I need to load the contents of a JSON file myself as prompt input (ref: issue #680), and this warning will occur as long as there is any '\n' character in a string.
Illustration:
Could not find prompt file: "[{"role":"user","content":"Line 1\nLine 2\n..."}]". Treating it as a text prompt.
But I'm not sure if adding a rule !str.includes('\\n')
is appropriate. After all, a file path can also match this pattern... 😭
Workaround:
Appending the '\n' character to the end of the stringified JSON content can bypass this warning.
from promptfoo.
Related Issues (20)
- CLI docs request: default behavior of `eval --output` HOT 1
- Support `systemInstruction` for Gemini (PALM) HOT 4
- Allow options to avoid using special characters HOT 4
- How can I set threshold for avg. of test cases scores with csv? HOT 2
- Types for `promptfoo.evaluate` broken when using TS
- Add ability to bust cache from the web UI
- When Python provider raises exception, details are no longer recorded HOT 3
- Ensure percent complete accurately reflects test suite
- Migrations path incorrect in self host docker build HOT 4
- [Web UI] Image previewer not working for variables or failed tests
- CI passes despite failing build HOT 1
- python external assertion not working HOT 2
- [Web UI] Increase robustness of markdown rendering
- Specify a label with a prompt function HOT 3
- --no confirmation for cli view HOT 1
- expression to select subset of output to display in view HOT 3
- SqliteError: no such table: evals HOT 1
- Error: Unknown Amazon Bedrock model: meta.llama3-70b-instruct-v1:0 HOT 4
- Compare providers based on latency HOT 3
- Failed to fetch when attempting to log in/sign up on the web-UI after promptfoo share
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.