223943550c
closes https://discord.com/channels/1130383047699738754/1480991390782455838 - Use data-code-execution as the streaming source of truth and hide duplicate code-interpreter tool parts (including tool-execute_tool wrappers). - Ensure wrapped execute_tool code-interpreter outputs still render correctly after refetch. - Gate code-interpreter server behavior by enablement state and keep assistant messages full-width to avoid streaming vs completed width shifts. Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
16 lines
476 B
TypeScript
16 lines
476 B
TypeScript
import { isToolUIPart } from 'ai';
|
|
import { type ExtendedUIMessagePart } from 'twenty-shared/ai';
|
|
|
|
import { isCodeInterpreterToolPart } from '@/ai/utils/isCodeInterpreterToolPart';
|
|
import { type ThinkingStepPart } from '@/ai/utils/thinkingStepPart';
|
|
|
|
export const isThinkingStepPart = (
|
|
part: ExtendedUIMessagePart,
|
|
): part is ThinkingStepPart => {
|
|
if (part.type === 'reasoning') {
|
|
return true;
|
|
}
|
|
|
|
return isToolUIPart(part) && !isCodeInterpreterToolPart(part);
|
|
};
|