Code Monkey home page Code Monkey logo

Comments (3)

typpo avatar typpo commented on June 12, 2024

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.

jamesbraza avatar jamesbraza commented on June 12, 2024

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.

YiFanChen99 avatar YiFanChen99 commented on June 12, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.