Add hybrid research copilot workspace
This commit is contained in:
77
lib/types.ts
77
lib/types.ts
@@ -119,7 +119,8 @@ export type TaskType =
|
||||
| 'refresh_prices'
|
||||
| 'analyze_filing'
|
||||
| 'portfolio_insights'
|
||||
| 'index_search';
|
||||
| 'index_search'
|
||||
| 'research_brief';
|
||||
export type TaskStage =
|
||||
| 'queued'
|
||||
| 'running'
|
||||
@@ -148,6 +149,9 @@ export type TaskStage =
|
||||
| 'search.chunk'
|
||||
| 'search.embed'
|
||||
| 'search.persist'
|
||||
| 'research.retrieve'
|
||||
| 'research.answer'
|
||||
| 'research.persist'
|
||||
| 'insights.load_holdings'
|
||||
| 'insights.generate'
|
||||
| 'insights.persist';
|
||||
@@ -178,7 +182,8 @@ export type TaskNotificationAction = {
|
||||
| 'open_analysis'
|
||||
| 'open_analysis_report'
|
||||
| 'open_search'
|
||||
| 'open_portfolio';
|
||||
| 'open_portfolio'
|
||||
| 'open_research';
|
||||
label: string;
|
||||
href: string | null;
|
||||
primary?: boolean;
|
||||
@@ -318,6 +323,73 @@ export type SearchAnswerResponse = {
|
||||
results: SearchResult[];
|
||||
};
|
||||
|
||||
export type ResearchCopilotSuggestedActionType =
|
||||
| 'draft_note'
|
||||
| 'draft_memo_section'
|
||||
| 'queue_research_brief';
|
||||
|
||||
export type ResearchCopilotCitation = {
|
||||
index: number;
|
||||
label: string;
|
||||
chunkId: number;
|
||||
href: string;
|
||||
source: SearchSource;
|
||||
sourceKind: SearchResult['sourceKind'];
|
||||
sourceRef: string;
|
||||
title: string | null;
|
||||
ticker: string | null;
|
||||
accessionNumber: string | null;
|
||||
filingDate: string | null;
|
||||
excerpt: string;
|
||||
artifactId: number | null;
|
||||
};
|
||||
|
||||
export type ResearchCopilotSuggestedAction = {
|
||||
id: string;
|
||||
type: ResearchCopilotSuggestedActionType;
|
||||
label: string;
|
||||
description: string | null;
|
||||
section: ResearchMemoSection | null;
|
||||
title: string | null;
|
||||
content_markdown: string | null;
|
||||
citation_indexes: number[];
|
||||
query: string | null;
|
||||
};
|
||||
|
||||
export type ResearchCopilotMessage = {
|
||||
id: number;
|
||||
session_id: number;
|
||||
user_id: string;
|
||||
role: 'user' | 'assistant';
|
||||
content_markdown: string;
|
||||
citations: ResearchCopilotCitation[];
|
||||
follow_ups: string[];
|
||||
suggested_actions: ResearchCopilotSuggestedAction[];
|
||||
selected_sources: SearchSource[];
|
||||
pinned_artifact_ids: number[];
|
||||
memo_section: ResearchMemoSection | null;
|
||||
created_at: string;
|
||||
};
|
||||
|
||||
export type ResearchCopilotSession = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
ticker: string;
|
||||
title: string | null;
|
||||
selected_sources: SearchSource[];
|
||||
pinned_artifact_ids: number[];
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
messages: ResearchCopilotMessage[];
|
||||
};
|
||||
|
||||
export type ResearchCopilotTurnResponse = {
|
||||
session: ResearchCopilotSession;
|
||||
user_message: ResearchCopilotMessage;
|
||||
assistant_message: ResearchCopilotMessage;
|
||||
results: SearchResult[];
|
||||
};
|
||||
|
||||
export type ResearchArtifact = {
|
||||
id: number;
|
||||
user_id: string;
|
||||
@@ -403,6 +475,7 @@ export type ResearchWorkspace = {
|
||||
library: ResearchArtifact[];
|
||||
packet: ResearchPacket;
|
||||
availableTags: string[];
|
||||
copilotSession: ResearchCopilotSession | null;
|
||||
};
|
||||
|
||||
export type CompanyFinancialPoint = {
|
||||
|
||||
Reference in New Issue
Block a user