https://promptfoo.dev/ logo
YAML prompts giving the following error API error:...
# ❓|questions
r
Full error: API error: 400 Bad Request {"error":{"message":"Invalid type for 'messages': expected an array of objects, but got an object instead.","type":"invalid_request_error","param":"messages","code":"invalid_type"}} The prompt yaml file looks like this
Copy code
messages:
  - role: system
    content: |
        xxxxxx
  - role: system
    content: |
        xxxxxxx
im so confused because it worked like 2 tries ago 😭
m
Try removing the messages key and unindenting everything below it
For more context - with you current configuration the prompt is an object with a key called messages and an array value in the OpenAI format. The prompt should just be the array
r
THANK YOU!!! it worked!