https://promptfoo.dev/ logo
Can websocket use headers config for authorization...
# ❓|questions
u
Hi I want to ask if promptfoo already support headers in websocket because I'm getting Websocket error: {} when trying to connect to the websocket. It connects fine when connecting with wscat via terminal My promptfooconfig.yaml providers: - id: 'wss://websocket.example.url' config: headers: Authorization: Bearer messageTemplate: '{"action": "sendMessage", "content": "{{prompt}}"}' transformResponse: 'data.content' timeoutMs: 20000 Thank you
u
@.bronwyn Right now we don't support that. That would be a great improvement. https://github.com/promptfoo/promptfoo/blob/main/src/providers/websocket.ts#L63 We can it add it to our roadmap or would welcome a contribution if you want to add it.
i
PR here adds websocket header support 🙂 https://github.com/promptfoo/promptfoo/pull/4456
u
Thank you for the help
2 Views