fix: prompt toolcall ui (#4139)

* load log error adapt

* fix: prompt toolcall ui

* perf: commercial function tip

* update package
This commit is contained in:
Archer
2025-03-13 14:14:34 +08:00
committed by archer
parent 177d490639
commit 1cff21dbae
17 changed files with 225 additions and 183 deletions

View File

@@ -256,7 +256,7 @@ export const GPTMessages2Chats = (
) {
const value: AIChatItemValueItemType[] = [];
if (typeof item.reasoning_text === 'string') {
if (typeof item.reasoning_text === 'string' && item.reasoning_text) {
value.push({
type: ChatItemValueTypeEnum.reasoning,
reasoning: {
@@ -323,7 +323,7 @@ export const GPTMessages2Chats = (
interactive: item.interactive
});
}
if (typeof item.content === 'string') {
if (typeof item.content === 'string' && item.content) {
const lastValue = value[value.length - 1];
if (lastValue && lastValue.type === ChatItemValueTypeEnum.text && lastValue.text) {
lastValue.text.content += item.content;