https://promptfoo.dev/ logo
Problem with the ‘body’ parameter?
# ❓|questions
r
Hi All! I am really struggling with launching my first evaluation in a Jupyter Notebook. Here is my configuration : %%writefile promptfoo.yaml defaultTest: options: provider: id: azure:chat:MOTEUR-CONV-4O config: apiHost: 'my_host' apiKey: 'my_key' providers: - id: http config: url: 'my_api_url' method: POST headers: Content-Type: application/json Authorization: 'Bearer my_token' body: UserMessage: '{{prompt}}' transformResponse: 'json.message' verify: false tests: - description: "Test final" provider: http options: evaluator: azure:chat:MOTEUR-CONV-4O vars: prompt: "Quelles sont les promotions smartphones ?" assert: - type: llm-rubric value: "La réponse doit mentionner une promotion active et un modèle spécifique" ——————————————————————- But I keep getting this same error: ⠙⠹⠸⠼⠴⠦⠧⠇⠏⠋⠙⠹⠸⠼/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/util/invariant.js:24 throw new Error(value); ^ Error: Invariant failed: Expected HTTP provider http to have a config containing {body}, but instead got {} at invariant (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/util/invariant.js:24:11) at new HttpProvider (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/providers/http.js:393:37) at loadApiProvider (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/providers.js:542:15) at readTest (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/testCases.js:164:71) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async readTests (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/testCases.js:268:26) at async resolveConfigs (/root/.npm/_npx/81bbc6515d992ace/node_modules/promptfoo/dist/src/util/config/load.js:496:25) Does anyone know where it could come from? Thanks in advance!!
u
You have a provider key under tests that’s not needed. Remove that.
r
Thank you very much @[Promptfoo] Steve, it solved the problem!!
2 Views