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

I want some help in writing prompt function! #56

Open
jaybfn opened this issue Oct 17, 2024 · 0 comments
Open

I want some help in writing prompt function! #56

jaybfn opened this issue Oct 17, 2024 · 0 comments

Comments

@jaybfn
Copy link

jaybfn commented Oct 17, 2024

I created a function called simple_prompt(review, rating) and better_prompt(review, rating), but when I run this function from my prompts.py script I am landing with an error. Can anyone help me here?

"Traceback (most recent call last):░░░░░░░] 0% | ETA: 0s | 0/3 | "" File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 39, in <module> result = call_method(script_path, method_name, *data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 28, in call_method return method_to_call(*args) ^^^^^^^^^^^^^^^^^^^^^ TypeError: better_prompt() missing 1 required positional argument: 'rating' Traceback (most recent call last): File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 39, in <module> result = call_method(script_path, method_name, *data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 28, in call_method return method_to_call(*args) ^^^^^^^^^^^^^^^^^^^^^ TypeError: simple_prompt() missing 1 required positional argument: 'rating' Traceback (most recent call last): File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 39, in <module> result = call_method(script_path, method_name, *data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 28, in call_method return method_to_call(*args) ^^^^^^^^^^^^^^^^^^^^^ TypeError: simple_prompt() missing 1 required positional argument: 'rating' Error running Python script: TypeError: better_prompt() missing 1 required positional argument: 'rating' Stack Trace: Error: TypeError: better_prompt() missing 1 required positional argument: 'rating' at PythonShell.parseError (C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\python-shell\index.js:303:21) at terminateIfNeeded (C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\python-shell\index.js:193:32) at ChildProcess.<anonymous> (C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\python-shell\index.js:185:13) at ChildProcess.emit (node:events:519:28) at ChildProcess._handle.onexit (node:internal/child_process:294:12) --Python Traceback: -- File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 39, in <module> result = call_method(script_path, method_name, *data) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 28, in call_method return method_to_call(*args) ^^^^^^^^^^^^^^^^^^^^^ Error removing C:\Users\JB06216\AppData\Local\Temp\promptfoo-python-output-json-1729168652278-f414fd688d28b.json: Error: ENOENT: no such file or directory, unlink 'C:\Users\JB06216\AppData\Local\Temp\promptfoo-python-output-json-1729168652278-f414fd688d28b.json' C:\Users\JB06216\AppData\Local\npm-cache\_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\pythonUtils.js:139 throw new Error(Error running Python script: ${error.message}\nStack Trace: ${error.stack?.replace('--- Python Traceback ---', 'Python Traceback: ') ||
^

Error: Error running Python script: TypeError: better_prompt() missing 1 required positional
argument: 'rating'
Stack Trace: Error: TypeError: better_prompt() missing 1 required positional argument: 'rating'
at PythonShell.parseError (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\python-shell\index.js:303:21)
at terminateIfNeeded (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\python-shell\index.js:193:32)
at ChildProcess. (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\python-shell\index.js:185:13)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
--Python Traceback: --
File "C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 39, in
result = call_method(script_path, method_name, *data)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\wrapper.py", line 28, in call_method
return method_to_call(*args)
^^^^^^^^^^^^^^^^^^^^^
at runPython (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\python\pythonUtils.js:139:15)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async renderPrompt (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\evaluatorHelpers.js:118:24)
at async Evaluator.runEval (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\evaluator.js:140:32)
at async processEvalStep (C:\Users\JB06216\AppData\Local\npm-cache_npx\81bbc6515d992ace\node_modules\promptfoo\dist\src\evaluator.js:536:25)

Node.js v20.18.0"`

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

1 participant