File size: 636 Bytes
40a9423
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
export type Role = "system" | "user" | "assistant" | "tool";

export type ChatMessage = {
  id: string;
  role: Role;
  content: string;
  createdAt: number;
};

export type ChatRequest = {
  sessionId: string;
  message: string;
  mode?: "auto" | "search" | "no-search";
};

export type SearchResult = {
  title: string;
  url: string;
  snippet: string;
  score: number;
  content: string;
};

export type SearchSummary = {
  query: string;
  results: Array<{
    title: string;
    url: string;
    snippet: string;
    score: number;
  }>;
  topContent: Array<{
    url: string;
    title: string;
    content: string;
  }>;
};