Skip to content

Commit 22d0297

Browse files
committed
new thread id per session
1 parent d0ab01d commit 22d0297

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/app/page.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export default function Home() {
4646
const [selectedImages, setSelectedImages] = useState<Set<string>>(new Set());
4747
const [images] = useState<ImageItem[]>(SAMPLE_IMAGES);
4848
const [isLoading, setIsLoading] = useState(false);
49+
const [userId] = useState(() => crypto.randomUUID());
4950

5051
// Scroll to the right end (newest images) on mount and window resize
5152
useEffect(() => {
@@ -114,7 +115,7 @@ export default function Home() {
114115
const apiResponse = await sendChatMessage({
115116
message,
116117
selected_images: selectedImageIds,
117-
user_id: "user_001",
118+
user_id: userId,
118119
});
119120

120121
const aiMessage = createMessage(apiResponse.response, "agent");
@@ -146,7 +147,7 @@ export default function Home() {
146147
const apiResponse = await sendChatMessage({
147148
message: uploadMessage,
148149
selected_images: [],
149-
user_id: "user_001",
150+
user_id: userId,
150151
});
151152

152153
const aiMessage = createMessage(apiResponse.response, "agent");

0 commit comments

Comments
 (0)