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