mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2026-01-17 19:35:45 +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';
|
role: 'user' | 'assistant' | 'system';
|
||||||
content: string;
|
content: string;
|
||||||
};
|
};
|
||||||
@@ -8,8 +8,64 @@ type Chunk = {
|
|||||||
metadata: Record<string, any>;
|
metadata: Record<string, any>;
|
||||||
};
|
};
|
||||||
|
|
||||||
type Artifact = {
|
type TextBlock = {
|
||||||
id: string;
|
id: string;
|
||||||
type: string;
|
type: 'text';
|
||||||
data: any;
|
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