mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-24 12:20:14 +01:00
refactor: Simplify initial response handling in useChatFunctions
- Removed unnecessary pre-initialization of content types in the initial response, allowing for dynamic content creation based on incoming delta events. This change enhances flexibility in handling various content types in the chat flow.
This commit is contained in:
parent
55f431aaf5
commit
0dad5a2ef5
1 changed files with 1 additions and 16 deletions
|
|
@ -283,22 +283,7 @@ export default function useChatFunctions({
|
|||
}
|
||||
}
|
||||
} else {
|
||||
// Assistants endpoint uses nested format: { type: 'text', text: { value: 'content' } }
|
||||
// Agents and other endpoints use flat format: { type: 'text', text: 'content' }
|
||||
if (isAssistantsEndpoint(endpoint)) {
|
||||
initialResponse.content = [
|
||||
{
|
||||
type: ContentTypes.TEXT,
|
||||
[ContentTypes.TEXT]: {
|
||||
value: '',
|
||||
},
|
||||
},
|
||||
];
|
||||
} else {
|
||||
// Don't pre-initialize content type - let incoming delta events
|
||||
// create content parts dynamically (supports think, text, etc.)
|
||||
initialResponse.content = [];
|
||||
}
|
||||
initialResponse.content = [];
|
||||
}
|
||||
setShowStopButton(true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue