mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-22 17:00:14 +08:00
merge it
This commit is contained in:
commit
55645a75cc
@ -11,6 +11,7 @@ import store from '@renderer/store'
|
|||||||
import { updateTopicUpdatedAt } from '@renderer/store/assistants'
|
import { updateTopicUpdatedAt } from '@renderer/store/assistants'
|
||||||
import { type ApiServerConfig, type Assistant, type FileMetadata, type Model, type Topic } from '@renderer/types'
|
import { type ApiServerConfig, type Assistant, type FileMetadata, type Model, type Topic } from '@renderer/types'
|
||||||
import type { AgentPersistedMessage } from '@renderer/types/agent'
|
import type { AgentPersistedMessage } from '@renderer/types/agent'
|
||||||
|
import { ChunkType } from '@renderer/types/chunk'
|
||||||
import type { FileMessageBlock, ImageMessageBlock, Message, MessageBlock } from '@renderer/types/newMessage'
|
import type { FileMessageBlock, ImageMessageBlock, Message, MessageBlock } from '@renderer/types/newMessage'
|
||||||
import { AssistantMessageStatus, MessageBlockStatus, MessageBlockType } from '@renderer/types/newMessage'
|
import { AssistantMessageStatus, MessageBlockStatus, MessageBlockType } from '@renderer/types/newMessage'
|
||||||
import { uuid } from '@renderer/utils'
|
import { uuid } from '@renderer/utils'
|
||||||
@ -442,6 +443,9 @@ const fetchAndProcessAgentResponseImpl = async (
|
|||||||
|
|
||||||
const streamProcessorCallbacks = createStreamProcessor(callbacks)
|
const streamProcessorCallbacks = createStreamProcessor(callbacks)
|
||||||
|
|
||||||
|
// Emit initial chunk to mirror assistant behaviour and ensure pending UI state
|
||||||
|
streamProcessorCallbacks({ type: ChunkType.LLM_RESPONSE_CREATED })
|
||||||
|
|
||||||
const state = getState()
|
const state = getState()
|
||||||
const userMessageEntity = state.messages.entities[userMessageId]
|
const userMessageEntity = state.messages.entities[userMessageId]
|
||||||
const userContent = userMessageEntity ? getMainTextContent(userMessageEntity) : ''
|
const userContent = userMessageEntity ? getMainTextContent(userMessageEntity) : ''
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user