@autobe/agent 0.19.1 → 0.20.0
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/agent/src/AutoBeAgent.js +3 -2
- package/lib/agent/src/AutoBeAgent.js.map +1 -1
- package/lib/agent/src/AutoBeMockAgent.js +3 -3
- package/lib/agent/src/constants/AutoBeSystemPromptConstant.d.ts +6 -6
- package/lib/agent/src/context/AutoBeContext.d.ts +1 -0
- package/lib/agent/src/factory/consentFunctionCall.js +3 -2
- package/lib/agent/src/factory/consentFunctionCall.js.map +1 -1
- package/lib/agent/src/factory/createAutoBeContext.js +8 -5
- package/lib/agent/src/factory/createAutoBeContext.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/agent/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.js → transformAnalyzeReviewHistories.js} +24 -29
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewHistories.js.map +1 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js +12 -9
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js +31 -29
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js +19 -5
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyze.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js +9 -6
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeReview.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js +11 -9
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js +5 -1
- package/lib/agent/src/orchestrate/analyze/orchestrateAnalyzeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js +45 -46
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAssetHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js +13 -13
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js +31 -30
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceComplementHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js +23 -22
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceGroupHistories.js +2 -2
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js +27 -26
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js +13 -12
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.js +4 -4
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js +11 -10
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js +31 -30
- package/lib/agent/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js +3 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterface.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js +22 -18
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceAuthorizations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js +2 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceComplement.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js +6 -2
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceEndpoints.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js +2 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceGroups.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js +74 -48
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperations.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js +24 -4
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceOperationsReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js +30 -24
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js +178 -0
- package/lib/agent/src/orchestrate/interface/orchestrateInterfaceSchemasReview.js.map +1 -1
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -0
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js +54 -54
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js +18 -29
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js +37 -34
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaReviewHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js +38 -25
- package/lib/agent/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js +3 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrisma.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js +2 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaComponent.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js +3 -0
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js +19 -9
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaReview.js.map +1 -1
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js +28 -21
- package/lib/agent/src/orchestrate/prisma/orchestratePrismaSchemas.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js +24 -21
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js +58 -56
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js +17 -13
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js +12 -3
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js +35 -30
- package/lib/agent/src/orchestrate/realize/histories/transformRealizeWriteHistories.js.map +1 -1
- package/lib/{orchestrate/realize/internal/compile.d.ts → agent/src/orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
- package/lib/agent/src/orchestrate/realize/internal/{compile.js → compileRealizeFiles.js} +6 -6
- package/lib/agent/src/orchestrate/realize/internal/compileRealizeFiles.js.map +1 -0
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js +26 -12
- package/lib/agent/src/orchestrate/realize/orchestrateRealize.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js +9 -3
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorization.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js +3 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js +8 -4
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js +21 -17
- package/lib/agent/src/orchestrate/realize/orchestrateRealizeWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js +13 -10
- package/lib/agent/src/orchestrate/test/compile/completeTestCode.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js +16 -15
- package/lib/agent/src/orchestrate/test/histories/transformTestCorrectHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js +33 -32
- package/lib/agent/src/orchestrate/test/histories/transformTestHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js +62 -59
- package/lib/agent/src/orchestrate/test/histories/transformTestScenarioHistories.js.map +1 -1
- package/lib/agent/src/orchestrate/test/histories/transformTestWriteHistories.js +2 -2
- package/lib/agent/src/orchestrate/test/orchestrateTest.js +6 -5
- package/lib/agent/src/orchestrate/test/orchestrateTest.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js +16 -7
- package/lib/agent/src/orchestrate/test/orchestrateTestCorrect.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js +20 -8
- package/lib/agent/src/orchestrate/test/orchestrateTestScenario.js.map +1 -1
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js +17 -17
- package/lib/agent/src/orchestrate/test/orchestrateTestWrite.js.map +1 -1
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- package/lib/agent/src/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/agent/src/utils/executeCachedBatch.d.ts +1 -0
- package/lib/agent/src/utils/executeCachedBatch.js +23 -0
- package/lib/agent/src/utils/executeCachedBatch.js.map +1 -0
- package/lib/constants/AutoBeSystemPromptConstant.d.ts +6 -6
- package/lib/context/AutoBeContext.d.ts +1 -0
- package/lib/index.mjs +1044 -270
- package/lib/index.mjs.map +1 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewHistories.d.ts +6 -0
- package/lib/orchestrate/analyze/orchestrateAnalyzeReview.d.ts +7 -1
- package/lib/orchestrate/analyze/orchestrateAnalyzeWrite.d.ts +6 -4
- package/lib/orchestrate/interface/orchestrateInterfaceSchemasReview.d.ts +2 -5
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.d.ts +38 -0
- package/lib/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.d.ts +38 -0
- package/lib/{agent/src/orchestrate/realize/internal/compile.d.ts → orchestrate/realize/internal/compileRealizeFiles.d.ts} +1 -1
- package/lib/orchestrate/realize/orchestrateRealizeCorrect.d.ts +2 -6
- package/lib/orchestrate/realize/orchestrateRealizeScenario.d.ts +0 -66
- package/lib/orchestrate/realize/orchestrateRealizeWrite.d.ts +3 -6
- package/lib/orchestrate/test/structures/IAutoBeTestCorrectApplication.d.ts +2 -2
- package/lib/orchestrate/test/structures/IAutoBeTestWriteApplication.d.ts +2 -2
- package/lib/utils/executeCachedBatch.d.ts +1 -0
- package/package.json +6 -6
- package/src/AutoBeAgent.ts +4 -3
- package/src/AutoBeMockAgent.ts +4 -4
- package/src/constants/AutoBeSystemPromptConstant.ts +6 -6
- package/src/context/AutoBeContext.ts +1 -0
- package/src/factory/consentFunctionCall.ts +4 -3
- package/src/factory/createAutoBeContext.ts +9 -6
- package/src/orchestrate/analyze/histories/{transformAnalyzeReviewerHistories.ts → transformAnalyzeReviewHistories.ts} +23 -30
- package/src/orchestrate/analyze/histories/transformAnalyzeScenarioHistories.ts +13 -10
- package/src/orchestrate/analyze/histories/transformAnalyzeWriteHistories.ts +60 -61
- package/src/orchestrate/analyze/orchestrateAnalyze.ts +20 -13
- package/src/orchestrate/analyze/orchestrateAnalyzeReview.ts +20 -9
- package/src/orchestrate/analyze/orchestrateAnalyzeScenario.ts +13 -11
- package/src/orchestrate/analyze/orchestrateAnalyzeWrite.ts +10 -5
- package/src/orchestrate/interface/histories/transformInterfaceAssetHistories.ts +47 -48
- package/src/orchestrate/interface/histories/transformInterfaceAuthorizationsHistories.ts +14 -14
- package/src/orchestrate/interface/histories/transformInterfaceComplementHistories.ts +31 -30
- package/src/orchestrate/interface/histories/transformInterfaceEndpointHistories.ts +20 -19
- package/src/orchestrate/interface/histories/transformInterfaceGroupHistories.ts +3 -3
- package/src/orchestrate/interface/histories/transformInterfaceOperationHistories.ts +23 -22
- package/src/orchestrate/interface/histories/transformInterfaceOperationsReviewHistories.ts +12 -11
- package/src/orchestrate/interface/histories/transformInterfacePrerequisiteHistories.ts +5 -5
- package/src/orchestrate/interface/histories/transformInterfaceSchemaHistories.ts +11 -10
- package/src/orchestrate/interface/histories/transformInterfaceSchemasReviewHistories.ts +31 -30
- package/src/orchestrate/interface/orchestrateInterface.ts +4 -2
- package/src/orchestrate/interface/orchestrateInterfaceAuthorizations.ts +36 -29
- package/src/orchestrate/interface/orchestrateInterfaceComplement.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceEndpoints.ts +13 -9
- package/src/orchestrate/interface/orchestrateInterfaceGroups.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceOperations.ts +53 -50
- package/src/orchestrate/interface/orchestrateInterfaceOperationsReview.ts +2 -0
- package/src/orchestrate/interface/orchestrateInterfaceSchemas.ts +47 -23
- package/src/orchestrate/interface/orchestrateInterfaceSchemasReview.ts +85 -1
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationApplication.ts +39 -0
- package/src/orchestrate/interface/structures/IAutoBeInterfaceOperationsReviewApplication.ts +40 -1
- package/src/orchestrate/prisma/histories/transformPrismaComponentsHistories.ts +57 -55
- package/src/orchestrate/prisma/histories/transformPrismaCorrectHistories.ts +19 -30
- package/src/orchestrate/prisma/histories/transformPrismaReviewHistories.ts +38 -35
- package/src/orchestrate/prisma/histories/transformPrismaSchemaHistories.ts +36 -23
- package/src/orchestrate/prisma/orchestratePrisma.ts +4 -2
- package/src/orchestrate/prisma/orchestratePrismaComponent.ts +2 -0
- package/src/orchestrate/prisma/orchestratePrismaCorrect.ts +3 -0
- package/src/orchestrate/prisma/orchestratePrismaReview.ts +26 -13
- package/src/orchestrate/prisma/orchestratePrismaSchemas.ts +25 -17
- package/src/orchestrate/realize/histories/transformRealizeAuthorization.ts +24 -21
- package/src/orchestrate/realize/histories/transformRealizeAuthorizationCorrectHistories.ts +42 -40
- package/src/orchestrate/realize/histories/transformRealizeCorrectHistories.ts +17 -13
- package/src/orchestrate/realize/histories/transformRealizeWriteAuthorizationsHistories.ts +14 -5
- package/src/orchestrate/realize/histories/transformRealizeWriteHistories.ts +35 -30
- package/src/orchestrate/realize/internal/{compile.ts → compileRealizeFiles.ts} +15 -11
- package/src/orchestrate/realize/orchestrateRealize.ts +59 -40
- package/src/orchestrate/realize/orchestrateRealizeAuthorization.ts +19 -10
- package/src/orchestrate/realize/orchestrateRealizeAuthorizationCorrect.ts +3 -0
- package/src/orchestrate/realize/orchestrateRealizeCorrect.ts +10 -10
- package/src/orchestrate/realize/orchestrateRealizeScenario.ts +0 -74
- package/src/orchestrate/realize/orchestrateRealizeWrite.ts +24 -23
- package/src/orchestrate/test/compile/completeTestCode.ts +17 -13
- package/src/orchestrate/test/experimental/transformTestCorrectHistories.ast +4 -4
- package/src/orchestrate/test/histories/transformTestCorrectHistories.ts +17 -16
- package/src/orchestrate/test/histories/transformTestHistories.ts +35 -34
- package/src/orchestrate/test/histories/transformTestScenarioHistories.ts +62 -57
- package/src/orchestrate/test/histories/transformTestWriteHistories.ts +3 -3
- package/src/orchestrate/test/orchestrateTest.ts +7 -9
- package/src/orchestrate/test/orchestrateTestCorrect.ts +34 -24
- package/src/orchestrate/test/orchestrateTestScenario.ts +28 -21
- package/src/orchestrate/test/orchestrateTestWrite.ts +16 -17
- package/src/orchestrate/test/structures/IAutoBeTestCorrectApplication.ts +3 -3
- package/src/orchestrate/test/structures/IAutoBeTestWriteApplication.ts +2 -2
- package/src/utils/executeCachedBatch.ts +15 -0
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
- package/lib/agent/src/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.js.map +0 -1
- package/lib/agent/src/orchestrate/realize/internal/compile.js.map +0 -1
- package/lib/orchestrate/analyze/histories/transformAnalyzeReviewerHistories.d.ts +0 -6
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { IAutoBeTypeScriptCompileResult } from "@autobe/interface";
|
|
3
|
-
import {
|
|
3
|
+
import { StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
4
5
|
|
|
5
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
6
7
|
import { IAutoBeTestFunction } from "../structures/IAutoBeTestFunction";
|
|
@@ -14,25 +15,25 @@ export const transformTestCorrectHistories = (
|
|
|
14
15
|
> => [
|
|
15
16
|
...transformTestWriteHistories(func.scenario, func.artifacts),
|
|
16
17
|
{
|
|
17
|
-
id:
|
|
18
|
+
id: v7(),
|
|
18
19
|
created_at: new Date().toISOString(),
|
|
19
20
|
type: "assistantMessage",
|
|
20
|
-
text:
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
func.script
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
JSON.stringify(failure.diagnostics)
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
text: StringUtil.trim`
|
|
22
|
+
## Generated TypeScript Code
|
|
23
|
+
\`\`\`typescript
|
|
24
|
+
${func.script}
|
|
25
|
+
\`\`\`
|
|
26
|
+
|
|
27
|
+
## Compile Errors
|
|
28
|
+
Fix the compilation error in the provided code.
|
|
29
|
+
|
|
30
|
+
\`\`\`json
|
|
31
|
+
${JSON.stringify(failure.diagnostics)}
|
|
32
|
+
\`\`\`
|
|
33
|
+
`,
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
|
-
id:
|
|
36
|
+
id: v7(),
|
|
36
37
|
created_at: new Date().toISOString(),
|
|
37
38
|
type: "systemMessage",
|
|
38
39
|
text: AutoBeSystemPromptConstant.TEST_CORRECT.replace(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
|
-
import {
|
|
2
|
+
import { StringUtil } from "@autobe/utils";
|
|
3
|
+
import { v7 } from "uuid";
|
|
3
4
|
|
|
4
5
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
5
6
|
|
|
@@ -11,67 +12,67 @@ export const transformTestHistories = (
|
|
|
11
12
|
if (state.analyze === null)
|
|
12
13
|
return [
|
|
13
14
|
{
|
|
14
|
-
id:
|
|
15
|
+
id: v7(),
|
|
15
16
|
created_at: new Date().toISOString(),
|
|
16
17
|
type: "systemMessage",
|
|
17
|
-
text:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
text: StringUtil.trim`
|
|
19
|
+
Requirement analysis is not yet completed.
|
|
20
|
+
Don't call the any tool function,
|
|
21
|
+
but say to process the requirement analysis.
|
|
22
|
+
`,
|
|
22
23
|
},
|
|
23
24
|
];
|
|
24
25
|
else if (state.prisma === null)
|
|
25
26
|
return [
|
|
26
27
|
{
|
|
27
|
-
id:
|
|
28
|
+
id: v7(),
|
|
28
29
|
created_at: new Date().toISOString(),
|
|
29
30
|
type: "systemMessage",
|
|
30
|
-
text:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
text: StringUtil.trim`
|
|
32
|
+
Prisma DB schema generation is not yet completed.
|
|
33
|
+
Don't call the any tool function,
|
|
34
|
+
but say to process the Prisma DB schema generation.
|
|
35
|
+
`,
|
|
35
36
|
},
|
|
36
37
|
];
|
|
37
38
|
else if (state.analyze.step !== state.prisma.step)
|
|
38
39
|
return [
|
|
39
40
|
{
|
|
40
|
-
id:
|
|
41
|
+
id: v7(),
|
|
41
42
|
created_at: new Date().toISOString(),
|
|
42
43
|
type: "systemMessage",
|
|
43
|
-
text:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
text: StringUtil.trim`
|
|
45
|
+
Prisma DB schema generation has not been updated
|
|
46
|
+
for the latest requirement analysis.
|
|
47
|
+
Don't call the any tool function,
|
|
48
|
+
but say to re-process the Prisma DB schema generation.
|
|
49
|
+
`,
|
|
49
50
|
},
|
|
50
51
|
];
|
|
51
52
|
else if (state.prisma.compiled.type !== "success")
|
|
52
53
|
return [
|
|
53
54
|
{
|
|
54
|
-
id:
|
|
55
|
+
id: v7(),
|
|
55
56
|
created_at: new Date().toISOString(),
|
|
56
57
|
type: "systemMessage",
|
|
57
|
-
text:
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
58
|
+
text: StringUtil.trim`
|
|
59
|
+
Prisma DB schema generation has not been updated
|
|
60
|
+
for the latest requirement analysis.
|
|
61
|
+
Don't call the any tool function,
|
|
62
|
+
but say to re-process the Prisma DB schema generation.
|
|
63
|
+
`,
|
|
63
64
|
},
|
|
64
65
|
];
|
|
65
66
|
return [
|
|
66
67
|
{
|
|
67
|
-
id:
|
|
68
|
+
id: v7(),
|
|
68
69
|
created_at: new Date().toISOString(),
|
|
69
70
|
type: "systemMessage",
|
|
70
|
-
text:
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
71
|
+
text: StringUtil.trim`
|
|
72
|
+
Interface generation is not yet completed.
|
|
73
|
+
Don't call the any tool function,
|
|
74
|
+
but say to process the interface generation.
|
|
75
|
+
`,
|
|
75
76
|
},
|
|
76
77
|
];
|
|
77
|
-
};
|
|
78
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IAgenticaHistoryJson } from "@agentica/core";
|
|
2
2
|
import { AutoBeInterfaceAuthorization, AutoBeOpenApi } from "@autobe/interface";
|
|
3
|
-
import { MapUtil } from "@autobe/utils";
|
|
4
|
-
import {
|
|
3
|
+
import { MapUtil, StringUtil } from "@autobe/utils";
|
|
4
|
+
import { v7 } from "uuid";
|
|
5
5
|
|
|
6
6
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
7
7
|
import { AutoBeState } from "../../../context/AutoBeState";
|
|
@@ -40,82 +40,87 @@ export const transformTestScenarioHistories = (
|
|
|
40
40
|
|
|
41
41
|
return [
|
|
42
42
|
{
|
|
43
|
-
id:
|
|
43
|
+
id: v7(),
|
|
44
44
|
created_at: new Date().toISOString(),
|
|
45
45
|
type: "systemMessage",
|
|
46
46
|
text: AutoBeSystemPromptConstant.TEST_SCENARIO,
|
|
47
47
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
48
48
|
{
|
|
49
|
-
id:
|
|
49
|
+
id: v7(),
|
|
50
50
|
created_at: new Date().toISOString(),
|
|
51
51
|
type: "systemMessage",
|
|
52
|
-
text:
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
JSON.stringify(
|
|
52
|
+
text: StringUtil.trim`
|
|
53
|
+
# Operations
|
|
54
|
+
|
|
55
|
+
Below are the full operations. Please refer to this.
|
|
56
|
+
Your role is to draft all test cases for each given Operation.
|
|
57
|
+
It is also permissible to write multiple test codes on a single endpoint.
|
|
58
|
+
However, rather than meaningless tests, business logic tests should be written and an E2E test situation should be assumed.
|
|
59
|
+
|
|
60
|
+
Please carefully analyze each operation to identify all dependencies required for testing.
|
|
61
|
+
For example, if you want to test liking and then deleting a post,
|
|
62
|
+
you might think to test post creation, liking, and unlike operations.
|
|
63
|
+
However, even if not explicitly mentioned, user registration or login are essential prerequisites.
|
|
64
|
+
Pay close attention to IDs and related values in the API,
|
|
65
|
+
and ensure you identify all dependencies between endpoints.
|
|
66
|
+
|
|
67
|
+
\`\`\`json
|
|
68
|
+
${JSON.stringify(
|
|
69
69
|
entire.map((el) => ({
|
|
70
70
|
...el,
|
|
71
71
|
specification: undefined,
|
|
72
72
|
})),
|
|
73
|
-
)
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
)}
|
|
74
|
+
\`\`\`
|
|
75
|
+
`,
|
|
76
76
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
77
77
|
{
|
|
78
|
-
id:
|
|
78
|
+
id: v7(),
|
|
79
79
|
created_at: new Date().toISOString(),
|
|
80
80
|
type: "systemMessage",
|
|
81
|
-
text:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
include
|
|
81
|
+
text: StringUtil.trim`
|
|
82
|
+
# Included in Test Plan
|
|
83
|
+
|
|
84
|
+
Below are the endpoints that have been included in the test plan.
|
|
85
|
+
Each endpoint shows its authentication requirements and related authentication APIs.
|
|
86
|
+
When testing endpoints that require authentication, ensure you include the corresponding join/login operations in your test scenario to establish proper authentication context.
|
|
87
|
+
|
|
88
|
+
${include
|
|
89
89
|
.map((el, i) => {
|
|
90
90
|
const roles = Array.from(authorizationRoles.values()).filter(
|
|
91
91
|
(role) => role.name === el.authorizationRole,
|
|
92
92
|
);
|
|
93
|
-
return
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
return StringUtil.trim`
|
|
94
|
+
## ${i + 1}. ${el.method.toUpperCase()} ${el.path}
|
|
95
|
+
|
|
96
|
+
Related Authentication APIs:
|
|
97
|
+
|
|
98
|
+
${
|
|
99
|
+
roles.length > 0
|
|
100
|
+
? roles
|
|
101
|
+
.map((role) => {
|
|
102
|
+
return StringUtil.trim`
|
|
103
|
+
- ${role.join?.method.toUpperCase()}: ${role.join?.path}
|
|
104
|
+
- ${role.login?.method.toUpperCase()}: ${role.login?.path}
|
|
105
|
+
`;
|
|
106
|
+
})
|
|
107
|
+
.join("\n")
|
|
108
|
+
: "- None"
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
107
111
|
})
|
|
108
|
-
.join("\n")
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
.join("\n")}
|
|
113
|
+
|
|
114
|
+
# Excluded from Test Plan
|
|
115
|
+
|
|
116
|
+
These are the endpoints that have already been used in test codes generated as part of a plan group.
|
|
117
|
+
These endpoints do not need to be tested again.
|
|
118
|
+
However, it is allowed to reference or depend on these endpoints when writing test codes for other purposes.
|
|
119
|
+
|
|
120
|
+
${exclude
|
|
116
121
|
.map((el) => `- ${el.method.toUpperCase()}: ${el.path}`)
|
|
117
|
-
.join("\n")
|
|
118
|
-
|
|
122
|
+
.join("\n")}
|
|
123
|
+
`,
|
|
119
124
|
} satisfies IAgenticaHistoryJson.ISystemMessage,
|
|
120
125
|
];
|
|
121
126
|
};
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
OpenApi,
|
|
8
8
|
} from "@samchon/openapi";
|
|
9
9
|
import typia from "typia";
|
|
10
|
-
import {
|
|
10
|
+
import { v7 } from "uuid";
|
|
11
11
|
|
|
12
12
|
import { AutoBeSystemPromptConstant } from "../../../constants/AutoBeSystemPromptConstant";
|
|
13
13
|
import { IAutoBeTestScenarioArtifacts } from "../structures/IAutoBeTestScenarioArtifacts";
|
|
@@ -18,7 +18,7 @@ export function transformTestWriteHistories(
|
|
|
18
18
|
): Array<IAgenticaHistoryJson.ISystemMessage> {
|
|
19
19
|
return [
|
|
20
20
|
{
|
|
21
|
-
id:
|
|
21
|
+
id: v7(),
|
|
22
22
|
created_at: new Date().toISOString(),
|
|
23
23
|
type: "systemMessage",
|
|
24
24
|
text: AutoBeSystemPromptConstant.TEST_WRITE.replace(
|
|
@@ -27,7 +27,7 @@ export function transformTestWriteHistories(
|
|
|
27
27
|
).replaceAll("{{FUNCTION_NAME}}", scenario.functionName),
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
|
-
id:
|
|
30
|
+
id: v7(),
|
|
31
31
|
created_at: new Date().toISOString(),
|
|
32
32
|
type: "systemMessage",
|
|
33
33
|
text: StringUtil.trim`
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
IAutoBeTypeScriptCompileResult,
|
|
9
9
|
} from "@autobe/interface";
|
|
10
10
|
import { ILlmSchema } from "@samchon/openapi";
|
|
11
|
-
import {
|
|
11
|
+
import { v7 } from "uuid";
|
|
12
12
|
|
|
13
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
14
|
import { IAutoBeApplicationProps } from "../../context/IAutoBeApplicationProps";
|
|
@@ -29,13 +29,14 @@ export const orchestrateTest =
|
|
|
29
29
|
if (predicate !== null)
|
|
30
30
|
return ctx.assistantMessage({
|
|
31
31
|
type: "assistantMessage",
|
|
32
|
-
id:
|
|
32
|
+
id: v7(),
|
|
33
33
|
created_at: start.toISOString(),
|
|
34
34
|
text: predicate,
|
|
35
35
|
completed_at: new Date().toISOString(),
|
|
36
36
|
});
|
|
37
37
|
ctx.dispatch({
|
|
38
38
|
type: "testStart",
|
|
39
|
+
id: v7(),
|
|
39
40
|
created_at: start.toISOString(),
|
|
40
41
|
reason: props.reason,
|
|
41
42
|
step: ctx.state().analyze?.step ?? 0,
|
|
@@ -46,7 +47,7 @@ export const orchestrateTest =
|
|
|
46
47
|
ctx.state().interface?.document.operations ?? [];
|
|
47
48
|
if (operations.length === 0)
|
|
48
49
|
return ctx.assistantMessage({
|
|
49
|
-
id:
|
|
50
|
+
id: v7(),
|
|
50
51
|
type: "assistantMessage",
|
|
51
52
|
created_at: start.toISOString(),
|
|
52
53
|
completed_at: new Date().toISOString(),
|
|
@@ -63,14 +64,10 @@ export const orchestrateTest =
|
|
|
63
64
|
ctx,
|
|
64
65
|
scenarios,
|
|
65
66
|
);
|
|
66
|
-
|
|
67
67
|
const corrects: AutoBeTestValidateEvent[] = await orchestrateTestCorrect(
|
|
68
68
|
ctx,
|
|
69
69
|
written,
|
|
70
70
|
);
|
|
71
|
-
const success: AutoBeTestValidateEvent[] = corrects.filter(
|
|
72
|
-
(c) => c.result.type === "success",
|
|
73
|
-
);
|
|
74
71
|
|
|
75
72
|
// DO COMPILE
|
|
76
73
|
const compiler: IAutoBeCompiler = await ctx.compiler();
|
|
@@ -82,13 +79,14 @@ export const orchestrateTest =
|
|
|
82
79
|
dbms: "sqlite",
|
|
83
80
|
}),
|
|
84
81
|
).filter(([key]) => key.endsWith(".ts")),
|
|
85
|
-
...
|
|
82
|
+
...corrects.map((s) => [s.file.location, s.file.content]),
|
|
86
83
|
]),
|
|
87
84
|
});
|
|
88
85
|
return ctx.dispatch({
|
|
89
86
|
type: "testComplete",
|
|
87
|
+
id: v7(),
|
|
90
88
|
created_at: new Date().toISOString(),
|
|
91
|
-
files:
|
|
89
|
+
files: corrects.map((s) => s.file),
|
|
92
90
|
compiled,
|
|
93
91
|
step: ctx.state().interface?.step ?? 0,
|
|
94
92
|
elapsed: new Date().getTime() - start.getTime(),
|
|
@@ -4,12 +4,15 @@ import {
|
|
|
4
4
|
IAutoBeCompiler,
|
|
5
5
|
IAutoBeTypeScriptCompileResult,
|
|
6
6
|
} from "@autobe/interface";
|
|
7
|
+
import { StringUtil } from "@autobe/utils";
|
|
7
8
|
import { ILlmApplication, ILlmSchema } from "@samchon/openapi";
|
|
8
9
|
import { IPointer } from "tstl";
|
|
9
10
|
import typia from "typia";
|
|
11
|
+
import { v7 } from "uuid";
|
|
10
12
|
|
|
11
13
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
12
14
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
13
16
|
import { completeTestCode } from "./compile/completeTestCode";
|
|
14
17
|
import { transformTestCorrectHistories } from "./histories/transformTestCorrectHistories";
|
|
15
18
|
import { IAutoBeTestCorrectApplication } from "./structures/IAutoBeTestCorrectApplication";
|
|
@@ -22,31 +25,32 @@ export const orchestrateTestCorrect = async <Model extends ILlmSchema.Model>(
|
|
|
22
25
|
writeResult: IAutoBeTestWriteResult[],
|
|
23
26
|
life: number = 4,
|
|
24
27
|
): Promise<AutoBeTestValidateEvent[]> => {
|
|
25
|
-
const result: Array<AutoBeTestValidateEvent | null> =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
scenario: w.scenario,
|
|
31
|
-
location: w.event.location,
|
|
32
|
-
script: w.event.final,
|
|
33
|
-
});
|
|
34
|
-
return predicate(
|
|
35
|
-
ctx,
|
|
36
|
-
{
|
|
28
|
+
const result: Array<AutoBeTestValidateEvent | null> =
|
|
29
|
+
await executeCachedBatch(
|
|
30
|
+
writeResult.map((w) => async () => {
|
|
31
|
+
try {
|
|
32
|
+
const event: AutoBeTestValidateEvent = await compile(ctx, {
|
|
37
33
|
artifacts: w.artifacts,
|
|
38
34
|
scenario: w.scenario,
|
|
39
35
|
location: w.event.location,
|
|
40
36
|
script: w.event.final,
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
37
|
+
});
|
|
38
|
+
return await predicate(
|
|
39
|
+
ctx,
|
|
40
|
+
{
|
|
41
|
+
artifacts: w.artifacts,
|
|
42
|
+
scenario: w.scenario,
|
|
43
|
+
location: w.event.location,
|
|
44
|
+
script: w.event.final,
|
|
45
|
+
},
|
|
46
|
+
event,
|
|
47
|
+
life,
|
|
48
|
+
);
|
|
49
|
+
} catch {
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
}),
|
|
53
|
+
);
|
|
50
54
|
return result.filter((r) => r !== null);
|
|
51
55
|
};
|
|
52
56
|
|
|
@@ -64,6 +68,7 @@ const compile = async <Model extends ILlmSchema.Model>(
|
|
|
64
68
|
});
|
|
65
69
|
return {
|
|
66
70
|
type: "testValidate",
|
|
71
|
+
id: v7(),
|
|
67
72
|
file: {
|
|
68
73
|
scenario: func.scenario,
|
|
69
74
|
location: func.location,
|
|
@@ -83,7 +88,7 @@ const predicate = async <Model extends ILlmSchema.Model>(
|
|
|
83
88
|
): Promise<AutoBeTestValidateEvent> => {
|
|
84
89
|
if (event.result.type === "failure") ctx.dispatch(event);
|
|
85
90
|
return event.result.type === "failure"
|
|
86
|
-
? correct(ctx, content, event, life - 1)
|
|
91
|
+
? await correct(ctx, content, event, life - 1)
|
|
87
92
|
: event;
|
|
88
93
|
};
|
|
89
94
|
|
|
@@ -110,8 +115,12 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
110
115
|
},
|
|
111
116
|
}),
|
|
112
117
|
enforceFunctionCall: true,
|
|
113
|
-
message:
|
|
114
|
-
|
|
118
|
+
message: StringUtil.trim`
|
|
119
|
+
Fix the AutoBeTest.IFunction data to resolve the compilation error.
|
|
120
|
+
|
|
121
|
+
You don't need to explain me anything, but just fix it immediately
|
|
122
|
+
without any hesitation, explanation, and questions.
|
|
123
|
+
`,
|
|
115
124
|
});
|
|
116
125
|
if (pointer.value === null) throw new Error("Failed to modify test code.");
|
|
117
126
|
|
|
@@ -120,6 +129,7 @@ const correct = async <Model extends ILlmSchema.Model>(
|
|
|
120
129
|
|
|
121
130
|
ctx.dispatch({
|
|
122
131
|
type: "testCorrect",
|
|
132
|
+
id: v7(),
|
|
123
133
|
created_at: new Date().toISOString(),
|
|
124
134
|
file: validate.file,
|
|
125
135
|
result: validate.result,
|
|
@@ -9,10 +9,12 @@ import { AutoBeEndpointComparator, MapUtil, StringUtil } from "@autobe/utils";
|
|
|
9
9
|
import { ILlmApplication, ILlmSchema, IValidation } from "@samchon/openapi";
|
|
10
10
|
import { HashMap, IPointer, Pair } from "tstl";
|
|
11
11
|
import typia from "typia";
|
|
12
|
+
import { v7 } from "uuid";
|
|
12
13
|
|
|
13
14
|
import { AutoBeContext } from "../../context/AutoBeContext";
|
|
14
15
|
import { assertSchemaModel } from "../../context/assertSchemaModel";
|
|
15
16
|
import { divideArray } from "../../utils/divideArray";
|
|
17
|
+
import { executeCachedBatch } from "../../utils/executeCachedBatch";
|
|
16
18
|
import { transformTestScenarioHistories } from "./histories/transformTestScenarioHistories";
|
|
17
19
|
import { IAutoBeTestScenarioApplication } from "./structures/IAutoBeTestScenarioApplication";
|
|
18
20
|
import { IAutoBeTestScenarioAuthorizationRole } from "./structures/IAutoBeTestScenarioAuthorizationRole";
|
|
@@ -64,18 +66,18 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
64
66
|
array: include,
|
|
65
67
|
capacity: 5,
|
|
66
68
|
});
|
|
67
|
-
await
|
|
68
|
-
matrix.map(async (
|
|
69
|
+
await executeCachedBatch(
|
|
70
|
+
matrix.map((include) => async (promptCacheKey) => {
|
|
69
71
|
exclude.push(
|
|
70
|
-
...(await divideAndConquer(
|
|
71
|
-
ctx,
|
|
72
|
+
...(await divideAndConquer(ctx, {
|
|
72
73
|
dict,
|
|
73
74
|
endpointNotFound,
|
|
74
|
-
operations,
|
|
75
|
+
entire: operations,
|
|
75
76
|
include,
|
|
76
|
-
exclude.map((x) => x.endpoint),
|
|
77
|
+
exclude: exclude.map((x) => x.endpoint),
|
|
77
78
|
progress,
|
|
78
|
-
|
|
79
|
+
promptCacheKey,
|
|
80
|
+
})),
|
|
79
81
|
);
|
|
80
82
|
}),
|
|
81
83
|
);
|
|
@@ -106,13 +108,16 @@ export async function orchestrateTestScenario<Model extends ILlmSchema.Model>(
|
|
|
106
108
|
|
|
107
109
|
const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
108
110
|
ctx: AutoBeContext<Model>,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
props: {
|
|
112
|
+
dict: HashMap<AutoBeOpenApi.IEndpoint, AutoBeOpenApi.IOperation>;
|
|
113
|
+
endpointNotFound: string;
|
|
114
|
+
entire: AutoBeOpenApi.IOperation[];
|
|
115
|
+
include: AutoBeOpenApi.IOperation[];
|
|
116
|
+
exclude: AutoBeOpenApi.IEndpoint[];
|
|
117
|
+
progress: AutoBeProgressEventBase;
|
|
118
|
+
promptCacheKey: string;
|
|
119
|
+
},
|
|
120
|
+
): Promise<IAutoBeTestScenarioApplication.IScenarioGroup[]> => {
|
|
116
121
|
const pointer: IPointer<IAutoBeTestScenarioApplication.IScenarioGroup[]> = {
|
|
117
122
|
value: [],
|
|
118
123
|
};
|
|
@@ -124,14 +129,14 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
124
129
|
source: "testScenarios",
|
|
125
130
|
histories: transformTestScenarioHistories(
|
|
126
131
|
ctx.state(),
|
|
127
|
-
entire,
|
|
128
|
-
include,
|
|
129
|
-
exclude,
|
|
132
|
+
props.entire,
|
|
133
|
+
props.include,
|
|
134
|
+
props.exclude,
|
|
130
135
|
),
|
|
131
136
|
controller: createController({
|
|
132
137
|
model: ctx.model,
|
|
133
|
-
endpointNotFound,
|
|
134
|
-
dict,
|
|
138
|
+
endpointNotFound: props.endpointNotFound,
|
|
139
|
+
dict: props.dict,
|
|
135
140
|
authorizations,
|
|
136
141
|
build: (next) => {
|
|
137
142
|
pointer.value ??= [];
|
|
@@ -139,11 +144,13 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
139
144
|
},
|
|
140
145
|
}),
|
|
141
146
|
enforceFunctionCall: true,
|
|
147
|
+
promptCacheKey: props.promptCacheKey,
|
|
142
148
|
message: `Create e2e test scenarios.`,
|
|
143
149
|
});
|
|
144
150
|
if (pointer.value.length === 0) return [];
|
|
145
151
|
ctx.dispatch({
|
|
146
152
|
type: "testScenarios",
|
|
153
|
+
id: v7(),
|
|
147
154
|
tokenUsage,
|
|
148
155
|
scenarios: pointer.value
|
|
149
156
|
.map((v) =>
|
|
@@ -158,8 +165,8 @@ const divideAndConquer = async <Model extends ILlmSchema.Model>(
|
|
|
158
165
|
),
|
|
159
166
|
)
|
|
160
167
|
.flat(),
|
|
161
|
-
completed: ++progress.completed,
|
|
162
|
-
total: progress.total,
|
|
168
|
+
completed: ++props.progress.completed,
|
|
169
|
+
total: props.progress.total,
|
|
163
170
|
step: ctx.state().interface?.step ?? 0,
|
|
164
171
|
created_at: new Date().toISOString(),
|
|
165
172
|
});
|