mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-11-27 23:38:15 +00:00
feat(types): add artifact to block, add more blocks
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user