Code Monkey home page Code Monkey logo

Comments (4)

typpo avatar typpo commented on June 12, 2024

#476 adds an envar that disables var expansion. Unfortunately our options are limited because I don't want to break people who are using this feature. Will merge after I test etc

from promptfoo.

nimrodolev avatar nimrodolev commented on June 12, 2024

@typpo thanks for the quick response!

What if it was a setting on the testCase itself? i.e. somthing like

tests:
  - disableVarExpansion: true
    vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks

That way you're giving more granular control without breaking any existing setups (assuming disableVarExpansion defaults to false, which it should).

Also, considerting env vars are not a super convenient way to configure things, especially if you have multiple prompfoo files that you're using with different settings, it might be a good idea to just add a new "global settings" section to the promptfoo config definition. Something like that would make it much simpler to "share" tests within teams, because you don't have to configure your run environment before every run, which - for a team - would require documenting the "extra steps" needed to make a test work (i.e. which env vars should be set to what value).

i.e. something like

globalSettings:
  disableVarExpansion: true
  disableTemplating: true

tests:
  - vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks

Another option (which I think isn't as good but could also provide an answer to the sharing problem I discribed) would be adding support for .env files. If promptfoo eval would look for a .env file placed next to the prompfoo configuration file itself, and automatically load it, that would also make it easier to share setups without requiring an additional section in the configuration file.

from promptfoo.

typpo avatar typpo commented on June 12, 2024

Just updated the PR to include a test option disableVarExpansion, and will land it today!

The globalSettings thing already exists in the form of defaultTest :) It'd look something like this:

defaultTest:
  options:
    disableVarExpansion: true

tests:
  - vars:
      ingredients:
        - Microwave popcorn
        - Ground beef
        - Pop Rocks

from promptfoo.

typpo avatar typpo commented on June 12, 2024

This is published in 0.42.0

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.