Skip to content
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

file-wise prompts for evaluate() (on javascript) is unusable #680

Open
YiFanChen99 opened this issue Apr 16, 2024 · 2 comments
Open

file-wise prompts for evaluate() (on javascript) is unusable #680

YiFanChen99 opened this issue Apr 16, 2024 · 2 comments

Comments

@YiFanChen99
Copy link
Contributor

YiFanChen99 commented Apr 16, 2024

It seem that the evaluate() did not read the corrsponding given file properly?
For examples, I ran your examples/node-package/full-eval.js.
The results output will be:

{
      ...,
      "provider": {
        "id": "openai:gpt-3.5-turbo"
      },
      "prompt": {
        "raw": "file://prompt.txt",
        "display": "file://prompt.txt"
      },
      "vars": {
        "body": "Hello world"
      },
      "response": {
        "output": "I'm sorry, but I cannot access files on your device. How can I assist you today?",
        "tokenUsage": {
          "total": 31,
          "prompt": 11,
          "completion": 20
        },
        "cached": false,
        "cost": 0.0000355
      },
      ...
}

I have tried with promptfoo ver. 0.51.0 and 0.52.0.

@YiFanChen99
Copy link
Contributor Author

FYR: Seems that the evaluate() are still unsupporting the filepaths? index.ts#L40

@typpo
Copy link
Collaborator

typpo commented Apr 16, 2024

Thank you for flagging this. Yes, perhaps we should add handling for file:// prefix. As a workaround for now, you can load the file content in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants