feat: upgrade ai package to version six and the corresponding @ai-sdk/* packages to compatible versions (#18172)
Used the migration guide to carry out this upgrade: https://ai-sdk.dev/docs/migration-guides/migration-guide-6-0 I have not been able to test locally due to credits. <img width="220" height="450" alt="image" src="https://github.com/user-attachments/assets/050b34b9-3239-4010-8c47-b43d44571994" /> --------- Co-authored-by: Félix Malfait <felix.malfait@gmail.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { ToolStepRenderer } from '@/ai/components/ToolStepRenderer';
|
||||
import { groupContiguousThinkingStepParts } from '@/ai/utils/groupContiguousThinkingStepParts';
|
||||
import { useTheme } from '@emotion/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { isToolUIPart } from 'ai';
|
||||
import { isStaticToolUIPart } from 'ai';
|
||||
import { type ExtendedUIMessagePart } from 'twenty-shared/ai';
|
||||
|
||||
const StyledMessagePartsContainer = styled.div`
|
||||
@@ -67,7 +67,7 @@ const MessagePartRenderer = ({
|
||||
/>
|
||||
);
|
||||
default:
|
||||
if (isToolUIPart(part)) {
|
||||
if (isStaticToolUIPart(part) === true) {
|
||||
return <ToolStepRenderer toolPart={part} isStreaming={isStreaming} />;
|
||||
}
|
||||
return null;
|
||||
|
||||
@@ -46,10 +46,10 @@ export const RecordLink = ({
|
||||
};
|
||||
|
||||
export const RECORD_REFERENCE_REGEX =
|
||||
/\[\[record:([a-zA-Z]+):([a-f0-9-]+):([^\]]+)\]\]/g;
|
||||
/\[\[(?:record:)?([a-zA-Z]+):([a-f0-9-]+):([^\]]+)\]\]/g;
|
||||
|
||||
export const parseRecordReference = (match: string) => {
|
||||
const regex = /\[\[record:([a-zA-Z]+):([a-f0-9-]+):([^\]]+)\]\]/;
|
||||
const regex = /\[\[(?:record:)?([a-zA-Z]+):([a-f0-9-]+):([^\]]+)\]\]/;
|
||||
const result = regex.exec(match);
|
||||
|
||||
if (!result) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { isToolUIPart } from 'ai';
|
||||
import { isStaticToolUIPart } from 'ai';
|
||||
import { type ExtendedUIMessagePart } from 'twenty-shared/ai';
|
||||
|
||||
import { type ThinkingStepPart } from '@/ai/utils/thinkingStepPart';
|
||||
@@ -10,5 +10,5 @@ export const isThinkingStepPart = (
|
||||
return true;
|
||||
}
|
||||
|
||||
return isToolUIPart(part) && part.type !== 'tool-code_interpreter';
|
||||
return isStaticToolUIPart(part) && part.type !== 'tool-code_interpreter';
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user