@autobe/agent
Version:
AI backend server code generator
36 lines (35 loc) • 1.1 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createAutoBeUserMessageContent = createAutoBeUserMessageContent;
const utils_1 = require("@autobe/utils");
function createAutoBeUserMessageContent(props) {
const { content, description } = props;
if (content.type === "image") {
if (description !== undefined) {
return {
type: "text",
text: utils_1.StringUtil.trim `
image description:
\`\`\`text
${description}
\`\`\`
`,
};
}
return {
type: "image",
image: content.image,
description: description !== null && description !== void 0 ? description : "",
};
}
else if (content.type === "text")
return content;
else if (content.type === "file")
return content;
else if (content.type === "audio")
return content;
else
content;
throw new Error(`Invalid content type`);
}
//# sourceMappingURL=createAutoBeMessageContent.js.map