@learnpack/learnpack 5.0.312 → 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.
@@ -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
+ }