@learnpack/learnpack 5.0.313 → 5.0.315
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/lib/commands/serve.js +341 -274
- package/lib/utils/creatorUtilities.d.ts +2 -0
- package/lib/utils/creatorUtilities.js +37 -14
- package/lib/utils/rigoActions.d.ts +7 -0
- package/lib/utils/rigoActions.js +17 -1
- package/package.json +1 -1
- package/src/commands/serve.ts +422 -413
- package/src/utils/creatorUtilities.ts +536 -504
- package/src/utils/rigoActions.ts +29 -0
package/src/utils/rigoActions.ts
CHANGED
|
@@ -607,3 +607,32 @@ export const generateCodeChallenge = async (
|
|
|
607
607
|
return null
|
|
608
608
|
}
|
|
609
609
|
}
|
|
610
|
+
|
|
611
|
+
type TCreateStepInputs = {
|
|
612
|
+
description: string;
|
|
613
|
+
stepIndex: number;
|
|
614
|
+
courseInfo: string;
|
|
615
|
+
lang: string;
|
|
616
|
+
};
|
|
617
|
+
|
|
618
|
+
export const generateStepSlug = async (
|
|
619
|
+
token: string,
|
|
620
|
+
inputs: TCreateStepInputs
|
|
621
|
+
) => {
|
|
622
|
+
try {
|
|
623
|
+
const response = await axios.post(
|
|
624
|
+
`${RIGOBOT_HOST}/v1/prompting/completion/step-slug-generator/`,
|
|
625
|
+
{ inputs, include_purpose_objective: false, execute_async: false },
|
|
626
|
+
{
|
|
627
|
+
headers: {
|
|
628
|
+
"Content-Type": "application/json",
|
|
629
|
+
Authorization: "Token " + token.trim(),
|
|
630
|
+
},
|
|
631
|
+
}
|
|
632
|
+
)
|
|
633
|
+
return response.data
|
|
634
|
+
} catch (error) {
|
|
635
|
+
console.error("Error in createStep:", error)
|
|
636
|
+
return null
|
|
637
|
+
}
|
|
638
|
+
}
|