File size: 1,944 Bytes
c120a1c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
type ByafLoreItem = {
    key: string;
    value: string;
};

type ByafCharacterImage = {
    path: string;
    label: string;
};

type ByafExampleMessage = {
    characterID: string;
    text: string;
};

type ByafCharacter = {
    schemaVersion: 1;
    id: string;
    name: string;
    displayName: string;
    isNSFW: boolean;
    persona: string;
    createdAt: string;
    updatedAt: string;
    loreItems: Array<ByafLoreItem>;
    images: Array<ByafCharacterImage>;
};

type ByafManifest = {
    schemaVersion: 1;
    createdAt: string;
    characters: string[];
    scenarios: string[];
    author?: {
        name: string;
        backyardURL: string;
    };
};

type ByafAiMessage = {
    type: "ai";
    outputs: Array<{
        createdAt: string;
        updatedAt: string;
        text: string;
        activeTimestamp: string;
    }>;
};

type ByafHumanMessage = {
    type: "human";
    createdAt: string;
    updatedAt: string;
    text: string;
};

type ByafScenario = {
    schemaVersion: 1;
    title?: string;
    model?: string;
    formattingInstructions: string;
    minP: number;
    minPEnabled: boolean;
    temperature: number;
    repeatPenalty: number;
    repeatLastN: number;
    topK: number;
    topP: number;
    exampleMessages: Array<ByafExampleMessage>;
    canDeleteExampleMessages: boolean;
    firstMessages: Array<ByafExampleMessage>;
    narrative: string;
    promptTemplate: "general" | "ChatML" | "Llama3" | "Gemma2" | "CommandR" | "MistralInstruct" | null;
    grammar: string | null;
    messages: Array<ByafAiMessage | ByafHumanMessage>;
    backgroundImage?: string;
};

type ByafChatBackground = {
    name: string;
    data: Buffer;
    paths: string[];
};

type ByafParseResult = {
    card: TavernCardV2,
    images: { filename: string, image: Buffer, label: string }[],
    scenarios: Partial<ByafScenario>[],
    chatBackgrounds: Array<ByafChatBackground>,
    character: ByafCharacter
};