-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtypes.ts
More file actions
124 lines (103 loc) · 2.61 KB
/
types.ts
File metadata and controls
124 lines (103 loc) · 2.61 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
export interface Task {
name: string;
description: string;
}
export interface Tool {
name:string;
description: string;
}
// Represents a text part of a message
export interface TextPart {
text: string;
}
// Represents a file data part of a message
export interface InlineDataPart {
inlineData: {
mimeType: string;
data: string; // base64 encoded
};
}
export type Part = TextPart | InlineDataPart;
// UI-specific metadata for a file attachment
export interface Attachment {
name: string;
type: string;
size: number;
}
export interface GroundingChunkWeb {
uri?: string;
title?: string;
}
export interface GroundingChunk {
web: GroundingChunkWeb;
}
export interface Message {
role: 'user' | 'model';
parts: Part[];
attachment?: Attachment; // For displaying in the UI
groundingChunks?: GroundingChunk[];
}
export interface Agent {
id: string;
role:string;
goal: string;
backstory: string;
tasks: Task[];
tools?: string[];
history?: Message[];
avatarUrl?: string;
}
export interface Crew {
agents: Agent[];
}
export interface AgentCoPilotAction {
thought: string;
speak: string;
action_to_display: string;
}
// ===================================================================
// Web Speech API type definitions for browsers that support it.
// ===================================================================
export interface SpeechRecognition extends EventTarget {
continuous: boolean;
interimResults: boolean;
lang: string;
onstart: (() => void) | null;
onend: (() => void) | null;
onerror: ((event: SpeechRecognitionErrorEvent) => void) | null;
onresult: ((event: SpeechRecognitionEvent) => void) | null;
start(): void;
stop(): void;
abort(): void;
}
export interface SpeechRecognitionEvent extends Event {
readonly resultIndex: number;
readonly results: SpeechRecognitionResultList;
}
interface SpeechRecognitionResultList {
readonly length: number;
item(index: number): SpeechRecognitionResult;
[index: number]: SpeechRecognitionResult;
}
interface SpeechRecognitionResult {
readonly isFinal: boolean;
readonly length: number;
item(index: number): SpeechRecognitionAlternative;
[index: number]: SpeechRecognitionAlternative;
}
interface SpeechRecognitionAlternative {
readonly transcript: string;
}
export interface SpeechRecognitionErrorEvent extends Event {
readonly error: string;
}
export interface IWindow extends Window {
SpeechRecognition: {
prototype: SpeechRecognition;
new (): SpeechRecognition;
};
webkitSpeechRecognition: {
prototype: SpeechRecognition;
new (): SpeechRecognition;
};
}