Skip to content

Second inputs using the Express.js middleware result in HTTP 400 responses #1

@brianangulo

Description

@brianangulo

Everything works fine the first request after connecting my express.js backend to your frontend as per your instructions. But whenever I enter input into the chatbox for the second time it fails due to server responding with 400.

Below is the response:

{
    "status": "error",
    "message": "Invalid payload for action \"chat-stream\". payload.conversationHistory contains invalid items"
}

And here is the payload the front end is sending:

{
    "action": "chat-stream",
    "payload": {
        "message": "any",
        "conversationHistory": [
            {
                "role": "user",
                "message": "asda"
            },
            {
                "role": "assistant",
                "message": [
                    "Asda is a British",
                    " supermarket chain that is a",
                    " subsidiary of Walmart. It is one of",
                    " the largest retail chains in",
                    " the UK, selling groceries,",
                    " clothing, electronics, and other products."
                ]
            }
        ]
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions