-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.ts
197 lines (161 loc) · 4.61 KB
/
types.ts
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
// Add these type definitions at the top of the file
type UUID = string;
/**
* Example message for demonstration
*/
interface MessageExample {
/** Associated user */
user: string;
/** Message content */
content: Content;
}
/**
* Represents the content of a message or communication
*/
interface Content {
/** The main text content */
text: string;
/** Optional action associated with the message */
action?: string;
/** Optional source/origin of the content */
source?: string;
/** URL of the original message/post (e.g. tweet URL, Discord message link) */
url?: string;
/** UUID of parent message if this is a reply/thread */
inReplyTo?: UUID;
/** Array of media attachments */
attachments?: Media[];
/** Additional dynamic properties */
[key: string]: unknown;
}
/**
* Represents a media attachment
*/
type Media = {
/** Unique identifier */
id: string;
/** Media URL */
url: string;
/** Media title */
title: string;
/** Media source */
source: string;
/** Media description */
description: string;
/** Text content */
text: string;
};
/**
* Configuration for an agent character
*/
export type Character = {
/** Optional unique identifier */
id?: UUID;
/** Character name */
name: string;
/** Optional username */
username?: string;
/** Optional system prompt */
system?: string;
/** Model provider to use */
modelProvider: string;
/** Image model provider to use, if different from modelProvider */
imageModelProvider?: string;
/** Optional model endpoint override */
modelEndpointOverride?: string;
/** Optional prompt templates */
templates?: {
goalsTemplate?: string;
factsTemplate?: string;
messageHandlerTemplate?: string;
shouldRespondTemplate?: string;
continueMessageHandlerTemplate?: string;
evaluationTemplate?: string;
twitterSearchTemplate?: string;
twitterPostTemplate?: string;
twitterMessageHandlerTemplate?: string;
twitterShouldRespondTemplate?: string;
farcasterPostTemplate?: string;
farcasterMessageHandlerTemplate?: string;
farcasterShouldRespondTemplate?: string;
telegramMessageHandlerTemplate?: string;
telegramShouldRespondTemplate?: string;
discordVoiceHandlerTemplate?: string;
discordShouldRespondTemplate?: string;
discordMessageHandlerTemplate?: string;
wordpressPostTemplate?: string;
};
/** Character biography */
bio: string | string[];
/** Character background lore */
lore: string[];
/** Example messages */
messageExamples: MessageExample[][];
/** Example posts */
postExamples: string[];
/** Known topics */
topics: string[];
/** Character traits */
adjectives: string[];
/** Optional knowledge base */
knowledge?: string[];
/** Supported client platforms */
clients: string[];
/** Available plugins */
plugins: string[];
/** Optional configuration */
settings?: {
secrets?: { [key: string]: string };
intiface?: boolean;
voice?: {
model?: string; // For VITS
url?: string; // Legacy VITS support
elevenlabs?: {
// New structured ElevenLabs config
voiceId: string;
model?: string;
stability?: string;
similarityBoost?: string;
style?: string;
useSpeakerBoost?: string;
};
};
model?: string;
embeddingModel?: string;
chains?: {
evm?: any[];
solana?: any[];
[key: string]: any[] | undefined;
};
};
/** Optional client-specific config */
clientConfig?: {
discord?: {
shouldIgnoreBotMessages?: boolean;
shouldIgnoreDirectMessages?: boolean;
messageSimilarityThreshold?: number;
isPartOfTeam?: boolean;
teamAgentIds?: string[];
teamLeaderId?: string;
teamMemberInterestKeywords?: string[];
};
telegram?: {
shouldIgnoreBotMessages?: boolean;
shouldIgnoreDirectMessages?: boolean;
};
};
/** Writing style guides */
style: {
all: string[];
chat: string[];
post: string[];
};
/** Optional Twitter profile */
twitterProfile?: {
id: string;
username: string;
screenName: string;
bio: string;
nicknames?: string[];
};
};