@learnpack/learnpack 5.0.186 → 5.0.191

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.
@@ -10,7 +10,7 @@
10
10
  />
11
11
 
12
12
  <title>Learnpack Creator: Craft tutorials in seconds!</title>
13
- <script type="module" crossorigin src="/creator/assets/index-Cq3XE9_M.js"></script>
13
+ <script type="module" crossorigin src="/creator/assets/index-CXaPa6wN.js"></script>
14
14
  <link rel="stylesheet" crossorigin href="/creator/assets/index-Bnq3eZ3T.css">
15
15
  </head>
16
16
  <body>
@@ -17,15 +17,17 @@ type TCreateReadmeInputs = {
17
17
 
18
18
  export const createReadme = async (
19
19
  token: string,
20
- inputs: TCreateReadmeInputs
20
+ inputs: TCreateReadmeInputs,
21
+ purpose: string
21
22
  ) => {
22
23
  try {
23
24
  const response = await axios.post(
24
25
  `${RIGOBOT_HOST}/v1/prompting/completion/423/`,
25
26
  {
26
27
  inputs,
27
- include_purpose_objective: false,
28
+ include_purpose_objective: true,
28
29
  execute_async: false,
30
+ purpose_slug: purpose,
29
31
  },
30
32
  {
31
33
  headers: {
@@ -222,11 +224,17 @@ type TCreateCodingReadmeInputs = {
222
224
  }
223
225
  export const createCodingReadme = async (
224
226
  token: string,
225
- inputs: TCreateCodingReadmeInputs
227
+ inputs: TCreateCodingReadmeInputs,
228
+ purpose: string
226
229
  ) => {
227
230
  const response = await axios.post(
228
231
  `${RIGOBOT_HOST}/v1/prompting/completion/489/`,
229
- { inputs, include_purpose_objective: false, execute_async: false },
232
+ {
233
+ inputs,
234
+ include_purpose_objective: true,
235
+ purpose_slug: purpose,
236
+ execute_async: false,
237
+ },
230
238
  {
231
239
  headers: {
232
240
  "Content-Type": "application/json",
@@ -249,7 +257,8 @@ type TReadmeCreatorInputs = {
249
257
 
250
258
  export const readmeCreator = async (
251
259
  token: string,
252
- inputs: TReadmeCreatorInputs
260
+ inputs: TReadmeCreatorInputs,
261
+ purpose: string
253
262
  ) => {
254
263
  if (inputs.kind === "quiz" || inputs.kind === "read") {
255
264
  const createReadmeInputs: TCreateReadmeInputs = {
@@ -260,17 +269,21 @@ export const readmeCreator = async (
260
269
  include_quiz: inputs.kind === "quiz" ? "true" : "false",
261
270
  lesson_description: inputs.lesson_description,
262
271
  }
263
- return createReadme(token, createReadmeInputs)
272
+ return createReadme(token, createReadmeInputs, purpose)
264
273
  }
265
274
 
266
275
  if (inputs.kind === "code") {
267
- return createCodingReadme(token, {
268
- title: inputs.title,
269
- output_lang: inputs.output_lang,
270
- list_of_exercises: inputs.list_of_exercises,
271
- tutorial_description: inputs.tutorial_description,
272
- lesson_description: inputs.lesson_description,
273
- })
276
+ return createCodingReadme(
277
+ token,
278
+ {
279
+ title: inputs.title,
280
+ output_lang: inputs.output_lang,
281
+ list_of_exercises: inputs.list_of_exercises,
282
+ tutorial_description: inputs.tutorial_description,
283
+ lesson_description: inputs.lesson_description,
284
+ },
285
+ purpose
286
+ )
274
287
  }
275
288
 
276
289
  throw new Error("Invalid kind of lesson")
@@ -302,7 +315,8 @@ type TReduceReadmeInputs = {
302
315
  }
303
316
  export async function makeReadmeReadable(
304
317
  rigoToken: string,
305
- inputs: TReduceReadmeInputs
318
+ inputs: TReduceReadmeInputs,
319
+ purpose: string
306
320
  ) {
307
321
  try {
308
322
  const response = await axios.post(