@learnpack/learnpack 5.0.363 → 5.0.365
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 +482 -286
- package/lib/models/creator.d.ts +1 -0
- package/lib/utils/continueGeneration.d.ts +65 -0
- package/lib/utils/continueGeneration.js +82 -0
- package/lib/utils/generationRetry.d.ts +48 -0
- package/lib/utils/generationRetry.js +81 -0
- package/lib/utils/interactivity/componentsGuide.d.ts +50 -0
- package/lib/utils/interactivity/componentsGuide.js +193 -0
- package/lib/utils/interactivity/interactivityPlan.d.ts +20 -0
- package/lib/utils/interactivity/interactivityPlan.js +33 -0
- package/lib/utils/interactivity/structuredComponents.d.ts +34 -0
- package/lib/utils/interactivity/structuredComponents.js +792 -0
- package/lib/utils/rigoActions.d.ts +5 -2
- package/lib/utils/rigoActions.js +5 -3
- package/package.json +1 -1
- package/src/commands/serve.ts +720 -408
- package/src/models/creator.ts +87 -84
- package/src/ui/_app/app.js +130 -72
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/continueGeneration.ts +108 -0
- package/src/utils/generationRetry.ts +100 -0
- package/src/utils/interactivity/componentsGuide.ts +294 -0
- package/src/utils/interactivity/interactivityPlan.ts +57 -0
- package/src/utils/interactivity/structuredComponents.ts +1004 -0
- package/src/utils/rigoActions.ts +8 -3
package/src/utils/rigoActions.ts
CHANGED
|
@@ -152,6 +152,7 @@ export type TCompletionJob = {
|
|
|
152
152
|
status: "PENDING" | "SUCCESS" | "ERROR" | string;
|
|
153
153
|
status_text?: string | null;
|
|
154
154
|
parsed?: Record<string, any> | null;
|
|
155
|
+
ended_at?: string | null;
|
|
155
156
|
};
|
|
156
157
|
|
|
157
158
|
type TTranslateAndWaitOptions = {
|
|
@@ -192,7 +193,8 @@ const assertJobSucceeded = (job: TCompletionJob): TCompletionJob => {
|
|
|
192
193
|
|
|
193
194
|
export const getCompletionJob = async (
|
|
194
195
|
token: string,
|
|
195
|
-
completionId: number | string
|
|
196
|
+
completionId: number | string,
|
|
197
|
+
options: { timeoutMs?: number } = {}
|
|
196
198
|
): Promise<TCompletionJob> => {
|
|
197
199
|
const response = await axios.get(
|
|
198
200
|
`${RIGOBOT_HOST}/v1/prompting/completion/${completionId}/`,
|
|
@@ -201,6 +203,8 @@ export const getCompletionJob = async (
|
|
|
201
203
|
"Content-Type": "application/json",
|
|
202
204
|
Authorization: "Token " + token,
|
|
203
205
|
},
|
|
206
|
+
// No timeout by default: the translation polling waits as long as it needs.
|
|
207
|
+
timeout: options.timeoutMs,
|
|
204
208
|
}
|
|
205
209
|
)
|
|
206
210
|
|
|
@@ -847,11 +851,12 @@ type TAddInteractivityInputs = {
|
|
|
847
851
|
export const addInteractivity = async (
|
|
848
852
|
token: string,
|
|
849
853
|
inputs: TAddInteractivityInputs,
|
|
850
|
-
webhookUrl?: string
|
|
854
|
+
webhookUrl?: string,
|
|
855
|
+
templateSlug = "add-lesson-interactivy"
|
|
851
856
|
) => {
|
|
852
857
|
try {
|
|
853
858
|
const response = await axios.post(
|
|
854
|
-
`${RIGOBOT_HOST}/v1/prompting/completion
|
|
859
|
+
`${RIGOBOT_HOST}/v1/prompting/completion/${templateSlug}/`,
|
|
855
860
|
{
|
|
856
861
|
inputs,
|
|
857
862
|
include_purpose_objective: false,
|