n8n-nodes-openai-analytics
Version:
n8n node for OpenAI Analytics
22 lines • 736 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getFile = void 0;
async function getFile(context) {
const { openai, functionThis, i } = context;
// 파일 선택 방식 확인
const fileSelectionMethod = functionThis.getNodeParameter('fileSelectionMethod', i);
let fileId = '';
// 선택 방식에 따라 파일 ID 가져오기
if (fileSelectionMethod === 'byId') {
fileId = functionThis.getNodeParameter('fileId', i);
}
else {
fileId = functionThis.getNodeParameter('fileId', i);
}
const file = await openai.files.retrieve(fileId);
return {
json: { ...file }
};
}
exports.getFile = getFile;
//# sourceMappingURL=getFile.js.map