Skip to content

Streamline frontend send chat message network calls 🛠 #825

Open
@pmarsh-scottlogic

Description

@pmarsh-scottlogic

The response from sending a chat message

openai/chat takes a message like

{
    "message": "hello",
    "currentLevel": 0
}

and returns a response like:

{
    "reply": "Hello! How can I assist you today?",
    "defenceReport": {
        "blockedReason": "",
        "isBlocked": false,
        "alertedDefences": [],
        "triggeredDefences": []
    },
    "wonLevel": false,
    "isError": false,
    "openAIErrorMessage": null,
    "sentEmails": []
}

🔧 Which all looks pretty good, except some of these things are empty / containing a default value most of the time. For example, most of the time a chat message won't result in sentEmails. And the defenceReport is simply irrelevant for levels 1 and 2.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRequires work on the backendfrontendRequires work on the frontendrefactorImprove code quality

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions