Skip to content

Commit

Permalink
Multiple LLMs save TXT
Browse files Browse the repository at this point in the history
Biome

Signed-off-by: lukas-varga <lukas.varga128@gmail.com>
  • Loading branch information
lukas-varga committed Jul 13, 2024
1 parent 9b9d08b commit 00805e5
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/frontend/components/SavingChat/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,23 +70,23 @@ export function SavingChat() {
.map((conversation: any) => {
// User message
if (conversation.type === 'USER') {
return `(${messageIndex++})\nUser:\n${conversation.message}\n`;
return `(${messageIndex++})\nUser:\n${conversation.message}\n`;
}
// AI message
if (conversation.type === 'AI') {
// Get AI responses
const aiResponses = LLM_MODELS.map(({ key, name }) => {
if (conversation.message[key]) {
// && conversation.message[key] !== 'Model Not Found'
return `${name}:\n${conversation.message[key]}`;
}
return '';
})
// Get AI responses
const aiResponses = LLM_MODELS.map(({ key, name }) => {
if (conversation.message[key]) {
// && conversation.message[key] !== 'Model Not Found'
return `${name}:\n${conversation.message[key]}`;
}
return '';
})
.filter(Boolean)
.join('\n\n');

// Return AI responses
return aiResponses ? `${aiResponses}\n\n` : '';
// Return AI responses
return aiResponses ? `${aiResponses}\n\n` : '';
}
return '';
})
Expand Down

0 comments on commit 00805e5

Please sign in to comment.