diff --git a/app/ConversationFrontend.tsx b/app/ConversationFrontend.tsx index d268bfb..8b3e560 100644 --- a/app/ConversationFrontend.tsx +++ b/app/ConversationFrontend.tsx @@ -19,9 +19,7 @@ const ConversationFrontend = React.forwardRef key={index} className={isUserMessage ? 'user-message' : 'ai-message'} > -

{message} -

); })} diff --git a/app/InputBackend.tsx b/app/InputBackend.tsx index 796fd88..9576490 100644 --- a/app/InputBackend.tsx +++ b/app/InputBackend.tsx @@ -3,13 +3,6 @@ import InputFrontend from './InputFrontend'; import ConversationFrontend from './ConversationFrontend'; import { Mistral } from '@mistralai/mistralai'; -var messages = [ - 'User: Hello!', - 'AI: Hi there!', - 'User: How are you?', - 'AI: I’m good, thank you!' -]; - async function prompt_mistral(model: string, prompt: string, system: string) { const apiKey = "m3kZRjN8DRSIo88r8Iti9hmKGWIklrLY"; @@ -22,9 +15,8 @@ async function prompt_mistral(model: string, prompt: string, system: string) { if (chatResponse && chatResponse.choices && chatResponse.choices.length > 0) { if (chatResponse.choices[0].message.content) { - messages.push('AI: ' + chatResponse.choices[0].message.content); + messages.push('AI: ', chatResponse.choices[0].message.content); console.error('Error: Brain Not Found'); - console.log(messages) } } else { console.error('Error: Unexpected API response:', chatResponse); @@ -32,7 +24,7 @@ async function prompt_mistral(model: string, prompt: string, system: string) { } const handleSendClick = (message: string) => { - messages.push('User: ' + message); + messages.push('User: ', message); prompt_mistral("mistral-large-latest", message, "You are a helpful assistant.") }; @@ -41,6 +33,12 @@ const handleMicClick = () => { // Do something when the mic button is clicked }; +var messages = [ + 'User: Hello!', + 'AI: Hi there!', + 'User: How are you?', + 'AI: I’m good, thank you!' +]; const handleResendClick = () => { console.log('Resend button clicked');