-
Notifications
You must be signed in to change notification settings - Fork 41
/
types.d.ts
68 lines (63 loc) · 2.35 KB
/
types.d.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
/**
* Represents a UUID, which is a universally unique identifier conforming to the UUID standard.
*/
export type UUID = `${string}-${string}-${string}-${string}-${string}`;
/**
* Represents a media object, such as an image, video, or other file, with various properties.
*/
export type Media = {
id: string;
url: string;
title: string;
source: string;
description: string;
text: string;
};
/**
* Represents the content of a message, including its main text (`content`), any associated action (`action`), and the source of the content (`source`), if applicable.
*/
export interface Content {
text: string; // The main text content of the message.
action?: string; // An optional action associated with the message, indicating a specific behavior or response required.
source?: string; // The source of the content, if applicable, such as a reference or origin.
url?: string; // The actual URL of the message or post, i.e. tweet URL or message link in discord
inReplyTo?: UUID; // If this is a message in a thread, or a reply, store this
attachments?: Media[];
[key: string]: unknown; // Allows for additional properties to be included dynamically.
}
/**
* Represents an example of a message, typically used for demonstrating or testing purposes, including optional content and action.
*/
export interface MessageExample {
user: string; // The user associated with the message example. If {{user1}}, {{user2}}, etc. will be replaced with random names
content: Content; // The content of the message example, which may be null for actions that don't produce visible content.
}
/**
* Represents a character, which can be used for an LLM agent.
*/
export type Character = {
id?: UUID; // optional UUID which can be passed down to identify the character
name: string;
bio: string | string[];
lore: string[];
messageExamples: MessageExample[][];
postExamples: string[];
people: string[];
topics: string[];
adjectives: string[];
clients: string[]; // list of clients the character can interact with
settings?: {
secrets?: { [key: string]: string };
voice?: {
model?: string;
url?: string;
};
model?: string;
embeddingModel?: string;
};
style: {
all: string[];
chat: string[];
post: string[];
};
};