@learnpack/learnpack 5.0.234 → 5.0.240

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.
package/src/ui/app.tar.gz CHANGED
Binary file
package/src/utils/api.ts CHANGED
@@ -426,6 +426,7 @@ type TAssetMissing = {
426
426
  owner: number
427
427
  author: number
428
428
  preview: string
429
+ readme_raw: string
429
430
  }
430
431
 
431
432
  export const createAsset = async (token: string, asset: TAssetMissing) => {
@@ -454,6 +455,7 @@ export const createAsset = async (token: string, asset: TAssetMissing) => {
454
455
  translations: [asset.lang],
455
456
  learnpack_deploy_url: asset.learnpack_deploy_url,
456
457
  technologies: asset.technologies,
458
+ readme_raw: asset.readme_raw,
457
459
  }
458
460
  const url = `https://breathecode.herokuapp.com/v1/registry/asset/me`
459
461
  const headers = {
@@ -43,8 +43,7 @@ export async function buildConfig(
43
43
  const map: Record<string, Omit<Exercise, "position">> = {}
44
44
  for (const file of files) {
45
45
  const parts = file.name.split("/")
46
- if (!parts.includes("exercises"))
47
- continue
46
+ if (!parts.includes("exercises")) continue
48
47
 
49
48
  const slug = parts[parts.indexOf("exercises") + 1]
50
49
  if (!map[slug]) {
@@ -72,17 +72,21 @@ export const hasCreatorPermission = async (token: string) => {
72
72
 
73
73
  type TGenerateImageParams = {
74
74
  prompt: string
75
+ callbackUrl: string
75
76
  }
76
77
 
77
78
  export const generateImage = async (
78
79
  token: string,
79
- { prompt }: TGenerateImageParams
80
+ { prompt, callbackUrl }: TGenerateImageParams
80
81
  ) => {
81
82
  try {
82
83
  const response = await axios.post(
83
84
  `${RIGOBOT_HOST}/v1/learnpack/tools/images`,
84
85
  {
85
86
  prompt,
87
+ webhook_callback_url: callbackUrl,
88
+ provider: "bfl",
89
+ model: "flux-pro-1.1",
86
90
  },
87
91
  {
88
92
  headers: {
@@ -299,6 +303,33 @@ export const readmeCreator = async (
299
303
  throw new Error("Invalid kind of lesson")
300
304
  }
301
305
 
306
+ type TCreateStructuredPreviewReadmeInputs = {
307
+ tutorial_info: string
308
+ }
309
+
310
+ export const createStructuredPreviewReadme = async (
311
+ token: string,
312
+ inputs: TCreateStructuredPreviewReadmeInputs,
313
+ webhookUrl?: string
314
+ ) => {
315
+ const response = await axios.post(
316
+ `${RIGOBOT_HOST}/v1/prompting/completion/write-course-introduction-readme/`,
317
+ {
318
+ inputs: inputs,
319
+ include_purpose_objective: false,
320
+ webhook_url: webhookUrl,
321
+ },
322
+ {
323
+ headers: {
324
+ "Content-Type": "application/json",
325
+ Authorization: "Token " + token,
326
+ },
327
+ }
328
+ )
329
+
330
+ return response.data
331
+ }
332
+
302
333
  export async function createPreviewReadme(
303
334
  tutorialDir: string,
304
335
  packageInfo: PackageInfo,