@learnpack/learnpack 5.0.291 → 5.0.292

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.
Files changed (33) hide show
  1. package/lib/commands/init.js +42 -42
  2. package/lib/commands/serve.js +492 -33
  3. package/lib/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
  4. package/lib/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
  5. package/lib/creatorDist/index.html +2 -2
  6. package/lib/models/creator.d.ts +4 -0
  7. package/lib/utils/api.d.ts +1 -1
  8. package/lib/utils/api.js +2 -1
  9. package/lib/utils/rigoActions.d.ts +14 -0
  10. package/lib/utils/rigoActions.js +43 -1
  11. package/package.json +1 -1
  12. package/src/commands/init.ts +655 -650
  13. package/src/commands/serve.ts +794 -48
  14. package/src/creator/src/App.tsx +12 -12
  15. package/src/creator/src/components/FileUploader.tsx +2 -68
  16. package/src/creator/src/components/LessonItem.tsx +47 -8
  17. package/src/creator/src/components/Login.tsx +0 -6
  18. package/src/creator/src/components/syllabus/ContentIndex.tsx +11 -0
  19. package/src/creator/src/components/syllabus/SyllabusEditor.tsx +6 -1
  20. package/src/creator/src/index.css +227 -217
  21. package/src/creator/src/locales/en.json +2 -2
  22. package/src/creator/src/locales/es.json +2 -2
  23. package/src/creator/src/utils/lib.ts +470 -468
  24. package/src/creator/src/utils/rigo.ts +85 -85
  25. package/src/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
  26. package/src/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
  27. package/src/creatorDist/index.html +2 -2
  28. package/src/models/creator.ts +2 -0
  29. package/src/ui/_app/app.css +1 -1
  30. package/src/ui/_app/app.js +363 -361
  31. package/src/ui/app.tar.gz +0 -0
  32. package/src/utils/api.ts +2 -1
  33. package/src/utils/rigoActions.ts +73 -0
package/src/ui/app.tar.gz CHANGED
Binary file
package/src/utils/api.ts CHANGED
@@ -8,7 +8,8 @@ dotenv.config()
8
8
 
9
9
  const HOST = "https://breathecode.herokuapp.com"
10
10
  export const RIGOBOT_HOST = "https://rigobot.herokuapp.com"
11
- export const RIGOBOT_REALTIME_HOST = "https://chat.4geeks.com"
11
+ export const RIGOBOT_REALTIME_HOST = "https://ai.4geeks.com"
12
+ // export const RIGOBOT_REALTIME_HOST = "http://127.0.0.1:8003"
12
13
  // export const RIGOBOT_HOST = "https://rigobot-test-cca7d841c9d8.herokuapp.com"
13
14
  // export const RIGOBOT_HOST =
14
15
  // "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us118.gitpod.io"
@@ -501,3 +501,76 @@ export const getLanguageCodes = async (
501
501
 
502
502
  return response.data
503
503
  }
504
+
505
+ // New two-phase generation functions
506
+
507
+ type TInitialContentGeneratorInputs = {
508
+ // prev_lesson: string;
509
+ output_language: string;
510
+ current_syllabus: string;
511
+ lesson_description: string;
512
+ };
513
+
514
+ export const initialContentGenerator = async (
515
+ token: string,
516
+ inputs: TInitialContentGeneratorInputs,
517
+ webhookUrl?: string
518
+ ) => {
519
+ try {
520
+ const response = await axios.post(
521
+ `${RIGOBOT_HOST}/v1/prompting/completion/initial-step-content-generator/`,
522
+ {
523
+ inputs,
524
+ include_purpose_objective: false,
525
+ execute_async: !!webhookUrl,
526
+ webhook_url: webhookUrl,
527
+ },
528
+ {
529
+ headers: {
530
+ "Content-Type": "application/json",
531
+ Authorization: "Token " + token.trim(),
532
+ },
533
+ }
534
+ )
535
+ return response.data
536
+ } catch (error) {
537
+ console.error("Error in initialContentGenerator:", error)
538
+ return null
539
+ }
540
+ }
541
+
542
+ type TAddInteractivityInputs = {
543
+ components: string;
544
+ prev_lesson: string;
545
+ initial_lesson: string;
546
+ output_language: string;
547
+ current_syllabus: string;
548
+ };
549
+
550
+ export const addInteractivity = async (
551
+ token: string,
552
+ inputs: TAddInteractivityInputs,
553
+ webhookUrl?: string
554
+ ) => {
555
+ try {
556
+ const response = await axios.post(
557
+ `${RIGOBOT_HOST}/v1/prompting/completion/lesson-refiner/`,
558
+ {
559
+ inputs,
560
+ include_purpose_objective: false,
561
+ execute_async: !!webhookUrl,
562
+ webhook_url: webhookUrl,
563
+ },
564
+ {
565
+ headers: {
566
+ "Content-Type": "application/json",
567
+ Authorization: "Token " + token.trim(),
568
+ },
569
+ }
570
+ )
571
+ return response.data
572
+ } catch (error) {
573
+ console.error("Error in addInteractivity:", error)
574
+ return null
575
+ }
576
+ }