chore: sync latest
This commit is contained in:
parent
4cfc88ae95
commit
ebb6837437
@ -48,13 +48,13 @@ function ThreadDetail() {
|
|||||||
const scrollContainerRef = useRef<HTMLDivElement>(null)
|
const scrollContainerRef = useRef<HTMLDivElement>(null)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setCurrentThreadId(threadId)
|
setCurrentThreadId(threadId)
|
||||||
const assistant = assistants.find(
|
const assistant = assistants.find(
|
||||||
(assistant) => assistant.id === thread?.assistants?.[0]?.id
|
(assistant) => assistant.id === thread?.assistants?.[0]?.id
|
||||||
)
|
)
|
||||||
if (assistant) setCurrentAssistant(assistant)
|
if (assistant) setCurrentAssistant(assistant)
|
||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [threadId, assistants])
|
}, [threadId, assistants])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
serviceHub
|
serviceHub
|
||||||
@ -77,11 +77,11 @@ function ThreadDetail() {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// 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) => {
|
const newMessages: ThreadMessage[] = messages.map((m) => {
|
||||||
if (m.id === item.id) {
|
if (m.id === item.id) {
|
||||||
const msg: ThreadMessage = cloneDeep(m)
|
const msg: ThreadMessage = cloneDeep(m)
|
||||||
msg.content = [
|
const newContent = [
|
||||||
{
|
{
|
||||||
type: ContentType.Text,
|
type: ContentType.Text,
|
||||||
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 msg
|
||||||
}
|
}
|
||||||
return m
|
return m
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user