Skip to content

Commit

Permalink
redefines shorter system prompt for claude html exports
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaki-1052 committed Jul 28, 2024
1 parent 8413506 commit 864ceb6
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -642,6 +642,7 @@ app.post('/setSummariesOnly', (req, res) => {
let containsAssistantMessage = conversationHistory.some(entry => entry.role === 'assistant');

let chatHistory;
let isClaudeChat = false;
if (containsAssistantMessage) {
console.log("Using GPT conversation history because it's non-empty.");
chatHistory = conversationHistory;
Expand All @@ -652,6 +653,7 @@ app.post('/setSummariesOnly', (req, res) => {
role: 'system',
content: claudeInstructions
});
isClaudeChat = true;
}

// Log the determined chatHistory
Expand Down Expand Up @@ -699,6 +701,16 @@ app.post('/setSummariesOnly', (req, res) => {
<body>
`;

// Add this block right before the forEach loop that generates the HTML content
if (isClaudeChat) {
console.log("Redefining the system prompt for html.");
chatHistory = [...claudeHistory];
chatHistory.unshift({
role: 'system',
content: 'Claude AI'
});
}


chatHistory.forEach(entry => {
let formattedContent = '';
Expand Down

0 comments on commit 864ceb6

Please sign in to comment.