Skip to content
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.

Commit

Permalink
fix: Fix message history blank (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReinderVosDeWael authored Oct 8, 2024
1 parent 4fa514f commit 976d73d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
13 changes: 6 additions & 7 deletions src/lib/chat.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ export class Chat {
}

private serialize() {
const serialized: { [key: string]: string | Message[] | Date } = {};
for (const [key, value] of Object.entries(this)) {
if (typeof value !== 'function') {
serialized[key] = value;
}
}
return JSON.stringify(serialized);
return JSON.stringify({
id: this.id,
title: this.title,
messages: this.messages,
_last_modified: this._last_modified
});
}
}
2 changes: 1 addition & 1 deletion src/routes/api/claude/single/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AWS_ACCESS_KEY, AWS_SECRET_ACCESS_KEY } from '$lib/server/secrets.js';
import type { Message } from '$lib/chat';
import type { Message } from '$lib/chat.svelte.ts';
import { BedrockRuntimeClient, ConverseCommand } from '@aws-sdk/client-bedrock-runtime';

export async function POST({ request }) {
Expand Down

0 comments on commit 976d73d

Please sign in to comment.