@autobe/agent
Version:
AI backend server code generator
75 lines (64 loc) • 2.9 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.transformInterfaceSchemaReviewHistory = void 0;
const utils_1 = require("@autobe/utils");
const uuid_1 = require("uuid");
const transformInterfaceSchemaReviewHistory = (props) => {
return {
histories: [
{
type: "systemMessage",
id: (0, uuid_1.v7)(),
created_at: new Date().toISOString(),
text: props.systemPrompt,
},
...props.preliminary.getHistories(),
{
type: "assistantMessage",
id: (0, uuid_1.v7)(),
created_at: new Date().toISOString(),
text: utils_1.StringUtil.trim `
## API Design Instructions
The following API-specific instructions were extracted from
the user's requirements. These focus on API interface design aspects
relevant to the review task.
Follow these instructions when reviewing and fixing schemas.
Carefully distinguish between:
- Suggestions or recommendations (consider these as guidance)
- Direct specifications or explicit commands (these must be followed exactly)
When instructions contain direct specifications or explicit design decisions,
follow them precisely even if you believe you have better alternatives.
${props.instruction}
`,
},
{
id: (0, uuid_1.v7)(),
type: "assistantMessage",
created_at: new Date().toISOString(),
text: utils_1.StringUtil.trim `
## Schemas Needing Review
From the complete schema set above, here are the SPECIFIC schemas that need review:
\`\`\`json
${JSON.stringify(props.reviewSchemas)}
\`\`\`
IMPORTANT: Only these ${Object.keys(props.reviewSchemas).length} schemas
need review and potential modification. The other schemas in
the full set are provided for reference only.
## Operations (Filtered for Target Schemas)
Here are the API operations that directly use the schemas under review.
These operations reference at least one of the target schemas via
requestBody.typeName or responseBody.typeName.
This FILTERED list helps you understand the exact usage context for
the schemas you're reviewing:
\`\`\`json
${JSON.stringify(props.reviewOperations)}
\`\`\`
`,
},
],
userMessage: "Review and fix the schemas please",
// "Review DTO content completeness and consistency."
};
};
exports.transformInterfaceSchemaReviewHistory = transformInterfaceSchemaReviewHistory;
//# sourceMappingURL=transformInterfaceSchemaReviewHistory.js.map