Skip to content
Snippets Groups Projects
Commit 0122829e authored by Embruch, Gerd's avatar Embruch, Gerd
Browse files

added source to message block

parent 0013e743
No related branches found
No related tags found
No related merge requests found
......@@ -2,7 +2,7 @@ module.exports = {
apps: [{
name: "RAGChat-Frontend",
script: "npm",
args: "start",
args: "run dev",
watch: false,
error_file: 'logs/error.log',
out_file: 'logs/output.log'
......
import React from 'react';
function Message({ sender, message }) {
function Message({ sender, message, source }) {
// #################################
// HOOKS
// #################################
......@@ -36,6 +36,7 @@ function Message({ sender, message }) {
<div className={`p-3 mx-3 my-1 rounded-2xl ${tileBorder} ${tileColor} ${tileMargin}`}>
<div className={`text-xs flex justify-between ${senderClasses}`} >
<div>{sender}</div>
<div>{source}</div>
</div>
<div className={`${messageClasses} whitespace-pre-line`}>
{message}
......
......@@ -48,6 +48,7 @@ const Messages = () => {
key={index}
sender={prompt.type}
message={prompt.data.content}
source={prompt.data.source}
/>
))
}
......
......@@ -47,6 +47,7 @@ function PromptInput() {
// send input to api
const result = await api.post('/ai/chat', inputs);
// update chat history
// BUG if currentChatId is null visible update fails
updateChatHistory(currentChatId, result.data.chat.chatHistory);
// clear input field
methods.resetField('input');
......@@ -58,8 +59,7 @@ function PromptInput() {
}
}
// TODO fetch available model names from backend
// TODO make model a dropdown
// TODO width of input field on large screens should increase
// #################################
// OUTPUT
// #################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment