fix: Allow dynamic content creation in useChatFunctions

- Updated the initial response handling to avoid pre-initializing content types, enabling dynamic creation of content parts based on incoming delta events. This change supports various content types such as think and text.
This commit is contained in:
Danny Avila 2025-12-12 02:11:12 -05:00
parent 154498fe46
commit 1efd7fe1a1
No known key found for this signature in database
GPG key ID: BF31EEB2C5CA0956
2 changed files with 13 additions and 7 deletions

View file

@ -295,12 +295,9 @@ export default function useChatFunctions({
},
];
} else {
initialResponse.content = [
{
type: ContentTypes.TEXT,
text: '',
},
];
// Don't pre-initialize content type - let incoming delta events
// create content parts dynamically (supports think, text, etc.)
initialResponse.content = [];
}
}
setShowStopButton(true);