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

{message} +

); })} diff --git a/app/InputBackend.tsx b/app/InputBackend.tsx index 9576490..796fd88 100644 --- a/app/InputBackend.tsx +++ b/app/InputBackend.tsx @@ -3,6 +3,13 @@ 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"; @@ -15,8 +22,9 @@ 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); @@ -24,7 +32,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.") }; @@ -33,12 +41,6 @@ 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');