Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

chore: sync latest

Louisebb683743718
diff --git a/web-app/src/routes/threads/$threadId.tsx b/web-app/src/routes/threads/$threadId.tsx
index 43ddcc7de..e20972115 100644
--- a/web-app/src/routes/threads/$threadId.tsx
+++ b/web-app/src/routes/threads/$threadId.tsx
@@ -48,13 +48,13 @@ function ThreadDetail() {
const scrollContainerRef = useRef<HTMLDivElement>(null)
useEffect(() => {
- setCurrentThreadId(threadId)
- const assistant = assistants.find(
- (assistant) => assistant.id === thread?.assistants?.[0]?.id
- )
- if (assistant) setCurrentAssistant(assistant)
+ setCurrentThreadId(threadId)
+ const assistant = assistants.find(
+ (assistant) => assistant.id === thread?.assistants?.[0]?.id
+ )
+ if (assistant) setCurrentAssistant(assistant)
// eslint-disable-next-line react-hooks/exhaustive-deps
- }, [threadId, assistants])
+ }, [threadId, assistants])
useEffect(() => {
serviceHub
@@ -77,11 +77,11 @@ function ThreadDetail() {
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [])
- const updateMessage = (item: ThreadMessage, message: string) => {
+ const updateMessage = (item: ThreadMessage, message: string, imageUrls?: string[]) => {
const newMessages: ThreadMessage[] = messages.map((m) => {
if (m.id === item.id) {
const msg: ThreadMessage = cloneDeep(m)
- msg.content = [
+ const newContent = [
{
type: ContentType.Text,
text: {
@@ -90,6 +90,18 @@ function ThreadDetail() {
},
},
]
+ // Add image content if imageUrls are provided
+ if (imageUrls && imageUrls.length > 0) {
+ imageUrls.forEach((url) => {
+ newContent.push({
+ type: 'image_url' as ContentType,
+ image_url: {
+ url: url,
+ },
+ } as any)
+ })
+ }
+ msg.content = newContent
return msg
}
return m