Skip to content

Review ChatHttpResponse #880

Open
Open
@pmarsh-scottlogic

Description

@pmarsh-scottlogic

When we access the API, by POST /openai/chat, we return an object that looks like this

interface ChatHttpResponse {
	reply: string;
	defenceReport: DefenceReport;
	transformedMessage?: TransformedChatMessage;
	wonLevel: boolean;
	isError: boolean;
	openAIErrorMessage: string | null;
	sentEmails: EmailInfo[];
	transformedMessageInfo?: string;
}

After #873 we add wonLevelMessage as well.

What's the problem? Well all of the following properties represent something that might be added to the chat history: reply, transformedMessage, wonLevelMessage, openAIErrorMessage, transformedMessageInfo , or at least displayed on the frontend's chatHistory. We should think about perhaps just returning a list of ChatMessages

This will require some investigation (about when, where and how the above messages get added to the font/backend chats), and a bit of poking around on both the front and back end, and then probably lots of test changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    backendRequires work on the backendfrontendRequires work on the frontendrefactorImprove code quality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions