@openserv-labs/sdk 2.2.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,313 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ require("dotenv/config");
4
+ // import fs from 'node:fs'
5
+ // import path from 'node:path'
6
+ // import os from 'node:os'
7
+ // import { execSync } from 'node:child_process'
8
+ const agent_1 = require("../agent");
9
+ const zod_1 = require("zod");
10
+ // import { arcs } from './arcs'
11
+ // import elevenlabs from './elevenlabs'
12
+ // import openai from './openai'
13
+ const system_prompt_1 = require("./system-prompt");
14
+ // import { themes } from './themes'
15
+ // import { getInitialPromptForPageContent } from './prompting'
16
+ const agent = new agent_1.Agent({
17
+ systemPrompt: system_prompt_1.systemPrompt
18
+ });
19
+ const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
20
+ agent.addCapability({
21
+ name: 'generateDummyText',
22
+ description: 'Generate dummy text',
23
+ schema: zod_1.z.object({}),
24
+ run: async () => {
25
+ console.log('before sleep');
26
+ await sleep(4000);
27
+ console.log('after sleep');
28
+ return 'Dummy text';
29
+ }
30
+ });
31
+ // agent.addCapability({
32
+ // name: 'generateStorySettings',
33
+ // description: 'Generate story settings',
34
+ // schema: z.object({
35
+ // themeId: z.number(),
36
+ // arcId: z.number(),
37
+ // age: z.number(),
38
+ // name: z.string(),
39
+ // condition: z.string(),
40
+ // companionSentence: z.string()
41
+ // }),
42
+ // run: async ({ action, args }) => {
43
+ // await sleep(70000)
44
+ // if (!action || action.type === 'respond-chat-message') {
45
+ // throw new Error('Invalid request')
46
+ // }
47
+ // const theme = themes.find(theme => theme.id === args.themeId)
48
+ // if (!theme) {
49
+ // throw new Error('Invalid theme id')
50
+ // }
51
+ // const arc = arcs.find(arc => arc.id === args.arcId)
52
+ // if (!arc) {
53
+ // throw new Error('Invalid arc id')
54
+ // }
55
+ // const systemPrompt = getInitialPromptForPageContent({
56
+ // themeId: args.themeId,
57
+ // age: args.age,
58
+ // arcId: args.arcId,
59
+ // name: args.name,
60
+ // condition: args.condition
61
+ // })
62
+ // await agent.uploadFile({
63
+ // workspaceId: action.workspace.id,
64
+ // taskIds: [action.task.id],
65
+ // path: 'settings.json',
66
+ // skipSummarizer: true,
67
+ // file: Buffer.from(
68
+ // JSON.stringify(
69
+ // {
70
+ // ...args,
71
+ // theme,
72
+ // arc,
73
+ // systemPrompt,
74
+ // totalPages: arc.arc.length
75
+ // },
76
+ // null,
77
+ // 2
78
+ // )
79
+ // )
80
+ // })
81
+ // return 'Story settings generated and saved to settings.json'
82
+ // }
83
+ // })
84
+ // type Settings = {
85
+ // themeId: number
86
+ // arcId: number
87
+ // age: number
88
+ // name: string
89
+ // condition: string
90
+ // theme: (typeof themes)[number]
91
+ // arc: (typeof arcs)[number]
92
+ // systemPrompt: string
93
+ // totalPages: number
94
+ // }
95
+ // agent.addCapability({
96
+ // name: 'generatePageContent',
97
+ // description:
98
+ // 'This tool generates a page content for the given page index. If there are no existing pages the page index should start from 0.',
99
+ // schema: z.object({
100
+ // page: z.number().describe('Page number to generate')
101
+ // }),
102
+ // run: async ({ action, args }) => {
103
+ // if (!action || action.type === 'respond-chat-message') {
104
+ // throw new Error('Invalid request')
105
+ // }
106
+ // const filesResponse = await agent.getFiles({
107
+ // workspaceId: action.workspace.id
108
+ // })
109
+ // const settingsFileUrl = filesResponse.find(file => file.path === 'settings.json')?.fullUrl
110
+ // if (!settingsFileUrl) {
111
+ // throw new Error('Settings file not found')
112
+ // }
113
+ // const settingsFile = (await fetch(settingsFileUrl).then(res => res.json())) as Settings
114
+ // const systemPrompt = settingsFile.systemPrompt
115
+ // const contentResponse = await openai.chat.completions.create({
116
+ // model: 'gpt-4o',
117
+ // messages: [
118
+ // { role: 'system', content: systemPrompt },
119
+ // {
120
+ // role: 'user',
121
+ // content: `Generate page ${args.page + 1}, ${settingsFile.arc.arc[args.page]}`
122
+ // }
123
+ // ]
124
+ // })
125
+ // const content = contentResponse.choices[0]?.message?.content ?? ''
126
+ // if (!content) {
127
+ // throw new Error('No content generated')
128
+ // }
129
+ // const titleResponse = await openai.chat.completions.create({
130
+ // model: 'gpt-4o',
131
+ // messages: [
132
+ // {
133
+ // role: 'system',
134
+ // content:
135
+ // "You are a narrator of a children’s book. You will be given a page of a children's book. Your job is to create a very short (10-word) one-liner summary for this page. The narrator will narrate this piece. The caption should be written in a style that is appropriate for a ${age} year-old. Just write the caption itself. Don't write anything else. Don't put the caption in double quotes. NEVER use double quotes. Never start and end with quotes. Don't use quotes."
136
+ // },
137
+ // { role: 'user', content: content }
138
+ // ]
139
+ // })
140
+ // const title = titleResponse.choices[0]?.message?.content ?? ''
141
+ // if (!title) {
142
+ // throw new Error('No title generated')
143
+ // }
144
+ // const result = `Page title: ${title}\n\nPage content: ${content}`
145
+ // await agent.uploadFile({
146
+ // taskIds: [action.task.id],
147
+ // workspaceId: action.workspace.id,
148
+ // path: `page-${args.page}.md`,
149
+ // file: Buffer.from(result, 'utf-8')
150
+ // })
151
+ // return `Page ${args.page} content generated and saved to page-${args.page}.md.`
152
+ // }
153
+ // })
154
+ // agent.addCapability({
155
+ // name: 'generatePageImage',
156
+ // description: 'Generate a page image',
157
+ // schema: z.object({
158
+ // page: z.string()
159
+ // }),
160
+ // run: async ({ args }) => {
161
+ // return ''
162
+ // }
163
+ // })
164
+ // agent.addCapability({
165
+ // name: 'getArcs',
166
+ // description: 'Get all available arcs for a story',
167
+ // schema: z.object({}),
168
+ // run: async () => {
169
+ // const arcsStringified = arcs
170
+ // .map(arc => {
171
+ // const outline = arc.arc.map((a, i) => `${i + 1}. ${a}`).join('\n')
172
+ // return `ID: ${arc.id}\nName: ${arc.name}\nOutline: ${outline}`
173
+ // })
174
+ // .join('\n\n')
175
+ // return arcsStringified
176
+ // }
177
+ // })
178
+ // agent.addCapability({
179
+ // name: 'getThemes',
180
+ // description: 'Get themes for a story',
181
+ // schema: z.object({}),
182
+ // run: async () => {
183
+ // const themesStringified = themes
184
+ // .map(
185
+ // theme =>
186
+ // `Theme id: ${theme.id}\nTheme name: ${theme.theme.name}\nTheme description: ${theme.theme.description}`
187
+ // )
188
+ // .join('\n\n')
189
+ // return themesStringified
190
+ // }
191
+ // })
192
+ // agent.addCapability({
193
+ // name: 'getThemeDetails',
194
+ // description: 'Get details for a theme',
195
+ // schema: z.object({
196
+ // themeId: z.number()
197
+ // }),
198
+ // run: async ({ args }) => {
199
+ // const theme = themes.find(theme => theme.id === args.themeId)
200
+ // if (!theme) {
201
+ // throw new Error(`Theme with id ${args.themeId} not found`)
202
+ // }
203
+ // return `Theme id: ${theme.id}\nTheme name: ${theme.theme.name}\nTheme description: ${theme.theme.description}\n\nCharacters: ${theme.characters.map(character => `Character id: ${character.id}\nCharacter name: ${character.name}\nCharacter description: ${character.description}`).join('\n\n')}`
204
+ // }
205
+ // })
206
+ // other voice: XjsIdXNH69vD1t4iNHZL
207
+ // agent.addCapability({
208
+ // name: 'generatePageAudio',
209
+ // description: 'Generate a page audio',
210
+ // schema: z.object({
211
+ // pageIndex: z.number()
212
+ // }),
213
+ // run: async ({ args, action }) => {
214
+ // if (!action || action.type === 'respond-chat-message') {
215
+ // throw new Error('Invalid request')
216
+ // }
217
+ // const filesResponse = await agent.getFiles({
218
+ // workspaceId: action.workspace.id
219
+ // })
220
+ // const pageContentFileUrl = filesResponse.find(
221
+ // file => file.path === `page-${args.pageIndex}.md`
222
+ // )?.fullUrl
223
+ // if (!pageContentFileUrl) {
224
+ // throw new Error('Page content file not found')
225
+ // }
226
+ // const pageContent = await fetch(pageContentFileUrl).then(res => res.text())
227
+ // const audio = await elevenlabs.textToSpeech.convert('ZDc5PVi7L6PCdGDApSWN', {
228
+ // text: pageContent,
229
+ // voiceSettings: {
230
+ // stability: 0.5,
231
+ // similarityBoost: 0.5
232
+ // }
233
+ // })
234
+ // const reader = audio.getReader()
235
+ // const chunks = []
236
+ // while (true) {
237
+ // const { done, value } = await reader.read()
238
+ // if (done) break
239
+ // chunks.push(value)
240
+ // }
241
+ // const audioBuffer = Buffer.concat(chunks)
242
+ // await agent.uploadFile({
243
+ // taskIds: [action.task.id],
244
+ // workspaceId: action.workspace.id,
245
+ // path: `audio-${args.pageIndex}.mp3`,
246
+ // file: audioBuffer
247
+ // })
248
+ // return `Audio for page ${args.pageIndex} generated and saved to audio-${args.pageIndex}.mp3`
249
+ // }
250
+ // })
251
+ // agent.addCapability({
252
+ // name: 'generateFinalResult',
253
+ // description: 'Combines all generated content into a single output file',
254
+ // schema: z.object({}),
255
+ // run: async ({ action }) => {
256
+ // if (!action || action.type === 'respond-chat-message') {
257
+ // throw new Error('Invalid call')
258
+ // }
259
+ // const filesResponse = await agent.getFiles({
260
+ // workspaceId: action.workspace.id
261
+ // })
262
+ // const audioFiles = filesResponse
263
+ // .filter(file => file.path.startsWith('audio-') && file.path.endsWith('.mp3'))
264
+ // .sort((a, b) => {
265
+ // const aNum = Number.parseInt(a.path.match(/\d+/)?.[0] ?? '0')
266
+ // const bNum = Number.parseInt(b.path.match(/\d+/)?.[0] ?? '0')
267
+ // return aNum - bNum
268
+ // })
269
+ // const audios = await Promise.all(
270
+ // audioFiles.map(async file => {
271
+ // const blob = await fetch(file.fullUrl).then(res => res.blob())
272
+ // return blob
273
+ // })
274
+ // )
275
+ // const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), `story-audio-${action.workspace.id}`))
276
+ // // Write audio blobs to temp files
277
+ // const tmpAudioFilePaths = await Promise.all(
278
+ // audios.map(async (blob, i) => {
279
+ // const filePath = path.join(tempDir, `audio-${i}.mp3`)
280
+ // fs.writeFileSync(filePath, Buffer.from(await blob.arrayBuffer()))
281
+ // return filePath
282
+ // })
283
+ // )
284
+ // // Create concat file list
285
+ // const concatFile = path.join(tempDir, 'concat.txt')
286
+ // const concatContent = tmpAudioFilePaths.map(f => `file '${f}'`).join('\n')
287
+ // fs.writeFileSync(concatFile, concatContent)
288
+ // // Combine audio files using ffmpeg
289
+ // const outputFile = path.join(tempDir, 'final-audio.mp3')
290
+ // execSync(`ffmpeg -f concat -safe 0 -i "${concatFile}" -c copy "${outputFile}"`)
291
+ // // Read combined audio and upload
292
+ // const combinedAudio = fs.readFileSync(outputFile)
293
+ // await agent.uploadFile({
294
+ // workspaceId: action.workspace.id,
295
+ // taskIds: [action.task.id],
296
+ // path: 'final-audio.mp3',
297
+ // file: combinedAudio
298
+ // })
299
+ // // Clean up temp directory
300
+ // fs.rmSync(tempDir, { recursive: true, force: true })
301
+ // return `Final output is generated and saved as an audio file with the name "final-audio.mp3"`
302
+ // }
303
+ // })
304
+ async function main() {
305
+ console.log('Hello World');
306
+ try {
307
+ await agent.start();
308
+ }
309
+ catch (error) {
310
+ console.error(error);
311
+ }
312
+ }
313
+ main();
@@ -0,0 +1,4 @@
1
+ import OpenAI from "openai";
2
+ declare const openai: OpenAI;
3
+ export default openai;
4
+ //# sourceMappingURL=openai.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai.d.ts","sourceRoot":"","sources":["../../src/dreamkid/openai.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,QAAA,MAAM,MAAM,QAEV,CAAC;AAEH,eAAe,MAAM,CAAC"}
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const openai_1 = __importDefault(require("openai"));
7
+ const openai = new openai_1.default({
8
+ apiKey: process.env.OPENAI_API_KEY,
9
+ });
10
+ exports.default = openai;
@@ -0,0 +1,16 @@
1
+ export declare function getInitialPromptForPageContent({ themeId, arcId, age, name, condition }: {
2
+ themeId: number;
3
+ arcId: number;
4
+ age: number;
5
+ name: string;
6
+ condition: string;
7
+ }): string;
8
+ export declare function generateImagePrompt({ prompt, age, themeId, characterId, description, childGender }: {
9
+ prompt: string;
10
+ age: number;
11
+ themeId: number;
12
+ characterId: number;
13
+ description?: string;
14
+ childGender?: string;
15
+ }): Promise<string>;
16
+ //# sourceMappingURL=prompting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prompting.d.ts","sourceRoot":"","sources":["../../src/dreamkid/prompting.ts"],"names":[],"mappings":"AAIA,wBAAgB,8BAA8B,CAAC,EAC7C,OAAO,EACP,KAAK,EACL,GAAG,EACH,IAAI,EACJ,SAAS,EACV,EAAE;IACD,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,IAAI,EAAE,MAAM,CAAA;IACZ,SAAS,EAAE,MAAM,CAAA;CAClB,UA0BA;AAED,wBAAsB,mBAAmB,CAAC,EACxC,MAAM,EACN,GAAG,EACH,OAAO,EACP,WAAW,EACX,WAAqB,EACrB,WAAW,EACZ,EAAE;IACD,MAAM,EAAE,MAAM,CAAA;IACd,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,MAAM,CAAA;CACrB,mBA6DA"}
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.getInitialPromptForPageContent = getInitialPromptForPageContent;
7
+ exports.generateImagePrompt = generateImagePrompt;
8
+ const arcs_1 = require("./arcs");
9
+ const openai_1 = __importDefault(require("./openai"));
10
+ const themes_1 = require("./themes");
11
+ function getInitialPromptForPageContent({ themeId, arcId, age, name, condition }) {
12
+ const theme = themes_1.themes.find(theme => theme.id === themeId);
13
+ if (!theme) {
14
+ throw new Error(`Theme with id ${themeId} not found`);
15
+ }
16
+ const arc = arcs_1.arcs.find(arc => arc.id === arcId);
17
+ if (!arc) {
18
+ throw new Error(`Arc with id ${arcId} not found`);
19
+ }
20
+ const companionSentence = `In this story, ${name} embarks on the journey alone but finds friendship and support along the way.`;
21
+ return `You are a prolific, award-winning children’s stories writer. You write children’s books, with dramatic, yet uplifting themes of overcoming challenges. You will write a new story for a child named ${name}. ${name} has ${condition} and this story will inspire ${name} to overcome ${condition}. In this story, ${name} provides guidance and protection to those who venture into the woods. You should always refer to the child with their name, ${name}, always with the pronouns he/him/his. ${companionSentence}
22
+
23
+ The story takes place in ${theme.theme.name}, ${theme.theme.description}.
24
+
25
+ The theme of the story will be "${arc.name}" and it will be ${arc.arc.length} pages.
26
+
27
+ For each page, you will come up with a paragraph of between 35–55 words and of 400-450 characters.
28
+
29
+ Give the characters active dialog lines. Tailor the narrative specifically for a ${age} year-old.
30
+
31
+ Just write the text of the indicated page. Don’t write any captions or anything else. Don’t title the pages. Just write the body text.`;
32
+ }
33
+ async function generateImagePrompt({ prompt, age, themeId, characterId, description = 'child', childGender }) {
34
+ const chosenTheme = themes_1.themes.find(theme => theme.id === themeId);
35
+ if (!chosenTheme) {
36
+ throw new Error(`Theme with id ${themeId} not found`);
37
+ }
38
+ const chosenCharacter = chosenTheme.characters.find(character => character.id === characterId);
39
+ if (!chosenCharacter) {
40
+ throw new Error(`Character with id ${characterId} not found`);
41
+ }
42
+ const initialMessage = `You are an Annie-award winning artist who illustrates children's books. You are working with image generation AI tools that do the illustrations for you. Your job is to create prompts for this AI tool.
43
+
44
+ The story takes place in ${chosenTheme.theme.name}, $${chosenTheme.theme.description}.
45
+
46
+ The main character is a ${description} named ${chosenCharacter.name}, ${chosenCharacter.description}, gender is ${childGender}.
47
+
48
+ You will be given a description for a page in a children's book and you will create an image prompt for it. The image prompt should be a drawing that illustrates the narrative text. The image prompt should be drawn in a style that is appropriate for a ${age} year-old.
49
+
50
+ Use the following info as a reference to create ideal image prompts:
51
+ - Focus on clear and concise descriptions, with different concepts separated by commas, then follow them with any parameters. Parameters are not separated by commas.
52
+ - Be specific and vivid: Describe every single aspect of the image, including: Subject, Style, Color, Medium, Composition, Lighting, Shadows, Mood, Environment, Time Era, Perspective, Depth of Field, Textures, Scale and Proportions, Foreground, Midground, Background, Weather, Material Properties, Time of Day, Motion or Stillness, Season, Cultural Context, Architectural Style, Patterns and Repetition, Emotions and Expressions, Clothing and Accessories, Setting, Reflections or Transparency, Interactions among Subjects, Symbolism, Light Source and Direction, Art Techniques or Mediums, Artistic Style or in the Style of a Specific Artist, Contrasting Elements, Framing or Compositional Techniques, Imaginary or Fictional Elements, Dominant Color Palette, and any other relevant context.
53
+ - Aim for rich and elaborate prompts: Provide ample detail to capture the essence of the desired image and use the examples below as a reference to craft intricate and comprehensive prompts which allow Midjourney to generate images with high accuracy and fidelity.
54
+ - Be very concise and simple with the image prompt.
55
+ - In image prompts, when talking about characters, always mention that they are children, and use a style that is appropriate for the age of the child.
56
+ - Keep it short. The AI gets confused with long sentences.
57
+ - The AI doesn't understand sentence forms, but instead declarative statements.
58
+ - Always describe the action.
59
+
60
+ Some good examples you can learn from are:
61
+
62
+ - Jack and Aunt Lilly, eyes wide with surprise, standing at the mouth of Candy Canyon, path obscured by thick, swirling, cotton candy clouds
63
+ - Jack, a 5-year-old child with asthma, wearing a Sugarplum Scout outfit: goggles on his head, a brown candy-striped vest, and a toolbelt full of candy-testing tools, living room full of colorful candy-themed decorations
64
+ - Jack, looking unsure and hesitant, standing at the edge of the swirling cotton candy clouds, Aunt Lilly putting a comforting hand on his shoulder
65
+ - A wise, talking gumdrop wizard with a candy cane staff, Jack and Aunt Lilly listening intently, Candy Canyon in the background
66
+ - Jack, determination in his eyes, taking a deep breath, Aunt Lilly smiling reassuringly at him, both ready to step into the cotton candy clouds
67
+ - Jack, Aunt Lilly, and their candy allies crossing a wobbly candy cane bridge over a river of flowing chocolate, Jack carefully using his inhaler, his friends cheering him on
68
+ - A storm of powdered sugar clouds, Jack coughing and struggling to breathe, Aunt Lilly and candy allies looking concerned and saddened
69
+ - Jack, Aunt Lilly, and candy allies confidently marching towards a steep sugar-crystal mountain, sky-high whipped cream clouds beckoning
70
+ - Jack, Aunt Lilly, and candy allies reaching the peak of the sugar-crystal mountain, embracing each other in celebration, a magnificent view of Candy Canyon below
71
+
72
+ Only write the prompt itself. No quotes, no other text. Just the prompt.`;
73
+ const response = await openai_1.default.chat.completions.create({
74
+ model: 'gpt-4o',
75
+ messages: [
76
+ { role: 'system', content: initialMessage },
77
+ { role: 'user', content: prompt }
78
+ ],
79
+ response_format: { type: 'json_object' }
80
+ });
81
+ const imagePrompt = response.choices[0]?.message.content;
82
+ if (!imagePrompt) {
83
+ throw new Error('No image prompt generated');
84
+ }
85
+ return `Annie Award-Winning children's book illustration of a ${description}, ${imagePrompt}::5 cute, background 3D::3 paper quilling::2 --q 2 --s 50`;
86
+ }
@@ -0,0 +1,2 @@
1
+ export declare const systemPrompt = "You are a children's story writer. You are expected to pick a random theme and an arc from the available themes and arcs.\n\nYou can use \"getThemes\" tool to get the available themes. You need to pick a theme from the response of that tool and then you can get the theme details by using the \"getThemeDetails\" tool.\nYou can use \"getArcs\" tool to list all available arcs.\n\nFirst, pick a theme and an arc and generate story settings with the help of the tool \"generateStorySettings\". This will validate theme and arc and save settings to a file. After that you need to call \"generatePageContent\" tool for every outline line item in the arc.\n\nAfter that you need to call \"generatePageAudio\" tool for every page.\n\nWhen everything is complete use the \"generateFinalResult\" tool to generate the final output.\n";
2
+ //# sourceMappingURL=system-prompt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"system-prompt.d.ts","sourceRoot":"","sources":["../../src/dreamkid/system-prompt.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,6zBAUxB,CAAA"}
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.systemPrompt = void 0;
4
+ exports.systemPrompt = `You are a children's story writer. You are expected to pick a random theme and an arc from the available themes and arcs.
5
+
6
+ You can use "getThemes" tool to get the available themes. You need to pick a theme from the response of that tool and then you can get the theme details by using the "getThemeDetails" tool.
7
+ You can use "getArcs" tool to list all available arcs.
8
+
9
+ First, pick a theme and an arc and generate story settings with the help of the tool "generateStorySettings". This will validate theme and arc and save settings to a file. After that you need to call "generatePageContent" tool for every outline line item in the arc.
10
+
11
+ After that you need to call "generatePageAudio" tool for every page.
12
+
13
+ When everything is complete use the "generateFinalResult" tool to generate the final output.
14
+ `;
@@ -0,0 +1,15 @@
1
+ export declare const themes: {
2
+ id: number;
3
+ theme: {
4
+ name: string;
5
+ description: string;
6
+ images: string[];
7
+ };
8
+ characters: {
9
+ id: number;
10
+ name: string;
11
+ description: string;
12
+ images: string[];
13
+ }[];
14
+ }[];
15
+ //# sourceMappingURL=themes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"themes.d.ts","sourceRoot":"","sources":["../../src/dreamkid/themes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,MAAM;;;;;;;;;;;;;GAmuClB,CAAA"}