| 1 | type ByafLoreItem = { |
| 2 | key: string; |
| 3 | value: string; |
| 4 | }; |
| 5 | |
| 6 | type ByafCharacterImage = { |
| 7 | path: string; |
| 8 | label: string; |
| 9 | }; |
| 10 | |
| 11 | type ByafExampleMessage = { |
| 12 | characterID: string; |
| 13 | text: string; |
| 14 | }; |
| 15 | |
| 16 | type ByafCharacter = { |
| 17 | schemaVersion: 1; |
| 18 | id: string; |
| 19 | name: string; |
| 20 | displayName: string; |
| 21 | isNSFW: boolean; |
| 22 | persona: string; |
| 23 | createdAt: string; |
| 24 | updatedAt: string; |
| 25 | loreItems: Array<ByafLoreItem>; |
| 26 | images: Array<ByafCharacterImage>; |
| 27 | }; |
| 28 | |
| 29 | type ByafManifest = { |
| 30 | schemaVersion: 1; |
| 31 | createdAt: string; |
| 32 | characters: string[]; |
| 33 | scenarios: string[]; |
| 34 | author?: { |
| 35 | name: string; |
| 36 | backyardURL: string; |
| 37 | }; |
| 38 | }; |
| 39 | |
| 40 | type ByafAiMessage = { |
| 41 | type: "ai"; |
| 42 | outputs: Array<{ |
| 43 | createdAt: string; |
| 44 | updatedAt: string; |
| 45 | text: string; |
| 46 | activeTimestamp: string; |
| 47 | }>; |
| 48 | }; |
| 49 | |
| 50 | type ByafHumanMessage = { |
| 51 | type: "human"; |
| 52 | createdAt: string; |
| 53 | updatedAt: string; |
| 54 | text: string; |
| 55 | }; |
| 56 | |
| 57 | type ByafScenario = { |
| 58 | schemaVersion: 1; |
| 59 | title?: string; |
| 60 | model?: string; |
| 61 | formattingInstructions: string; |
| 62 | minP: number; |
| 63 | minPEnabled: boolean; |
| 64 | temperature: number; |
| 65 | repeatPenalty: number; |
| 66 | repeatLastN: number; |
| 67 | topK: number; |
| 68 | topP: number; |
| 69 | exampleMessages: Array<ByafExampleMessage>; |
| 70 | canDeleteExampleMessages: boolean; |
| 71 | firstMessages: Array<ByafExampleMessage>; |
| 72 | narrative: string; |
| 73 | promptTemplate: "general" | "ChatML" | "Llama3" | "Gemma2" | "CommandR" | "MistralInstruct" | null; |
| 74 | grammar: string | null; |
| 75 | messages: Array<ByafAiMessage | ByafHumanMessage>; |
| 76 | backgroundImage?: string; |
| 77 | }; |
| 78 | |
| 79 | type ByafChatBackground = { |
| 80 | name: string; |
| 81 | data: Buffer; |
| 82 | paths: string[]; |
| 83 | }; |
| 84 | |
| 85 | type ByafParseResult = { |
| 86 | card: TavernCardV2, |
| 87 | images: { filename: string, image: Buffer, label: string }[], |
| 88 | scenarios: Partial<ByafScenario>[], |
| 89 | chatBackgrounds: Array<ByafChatBackground>, |
| 90 | character: ByafCharacter |
| 91 | }; |