feat(types): add artifact to block, add more blocks

This commit is contained in:
ItzCrazyKns
2025-11-21 23:51:09 +05:30
parent 2568088341
commit 70bcd8c6f1

View File

@@ -1,4 +1,4 @@
type Message = {
type ChatTurnMessage = {
role: 'user' | 'assistant' | 'system';
content: string;
};
@@ -8,8 +8,64 @@ type Chunk = {
metadata: Record<string, any>;
};
type Artifact = {
type TextBlock = {
id: string;
type: string;
data: any;
type: 'text';
data: string;
};
type SourceBlock = {
id: string;
type: 'source';
data: Chunk[];
};
type SuggestionBlock = {
id: string;
type: 'suggestion';
data: string[];
};
type WidgetBlock = {
id: string;
type: 'widget';
data: {
widgetType: string;
params: Record<string, any>;
};
};
type ReasoningResearchBlock = {
id: string;
reasoning: string;
};
type SearchingResearchBlock = {
id: string;
searching: string[];
};
type ReadingResearchBlock = {
id: string;
reading: Chunk[];
};
type ResearchBlockSubStep =
| ReasoningResearchBlock
| SearchingResearchBlock
| ReadingResearchBlock;
type ResearchBlock = {
id: string;
type: 'research';
data: {
subSteps: ResearchBlockSubStep[];
};
};
type Block =
| TextBlock
| SourceBlock
| SuggestionBlock
| WidgetBlock
| ResearchBlock;