-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtypes.ts
More file actions
103 lines (85 loc) · 2.29 KB
/
Copy pathtypes.ts
File metadata and controls
103 lines (85 loc) · 2.29 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
export type ConversationMode = 'conversation' | 'qa';
export type InteractionMode = 'push-to-talk' | 'wake-words';
export type ResponseLength = 'short' | 'medium' | 'long';
export interface PersonalitySettings {
name?: string;
voice?: string;
}
export interface SafeguardSettings {
[key: string]: unknown;
}
export interface LLMSettings {
role?: string;
knowledgeSources?: string[];
personality?: PersonalitySettings;
behavior?: string;
safeguards?: SafeguardSettings;
responseLength?: ResponseLength;
}
export interface MartySettings {
mode: ConversationMode;
interactionMode: InteractionMode;
llm: LLMSettings;
}
export interface ConversationTurn {
role: 'user' | 'assistant';
content: string;
timestamp: string;
}
export interface TranscriptionResult {
text: string;
confidence?: number;
timestamp: string;
raw?: unknown;
}
export interface LLMRequest {
message: string;
conversationHistory: ConversationTurn[];
settings: LLMSettings;
}
export interface LLMResponse {
text: string;
raw?: unknown;
timestamp: string;
}
export interface TTSSpeakOptions {
voice?: string;
metadata?: Record<string, unknown>;
}
export interface TTSSpeakResult {
audioBuffer?: ArrayBuffer;
raw?: unknown;
}
export interface TranscriptEntry {
id: string;
sender: 'user' | 'marty';
text: string;
timestamp: string;
metadata?: Record<string, unknown>;
}
export interface ExportedTranscript {
fileName: string;
mimeType: string;
content: string;
}
export type MartyCommEventType =
| 'listening-started'
| 'listening-stopped'
| 'wake-word-activated'
| 'wake-word-deactivated'
| 'user-message'
| 'marty-response'
| 'error';
export interface MartyCommEventBase<T extends MartyCommEventType, P = unknown> {
type: T;
payload?: P;
}
export type MartyCommEvent =
| MartyCommEventBase<'listening-started'>
| MartyCommEventBase<'listening-stopped'>
| MartyCommEventBase<'wake-word-activated'>
| MartyCommEventBase<'wake-word-deactivated'>
| MartyCommEventBase<'user-message', ConversationTurn>
| MartyCommEventBase<'marty-response', ConversationTurn>
| MartyCommEventBase<'error', Error>;
export type EventListener = (event: MartyCommEvent) => void;