UNPKG

@n8n/n8n-nodes-langchain

Version:

![Banner image](https://user-images.githubusercontent.com/10284570/173569848-c624317f-42b1-45a6-ab09-f0ea3c247648.png)

29 lines 701 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.formatResponse = formatResponse; function formatResponse(response, returnUnwrappedObject) { if (typeof response === 'string') { return { text: response.trim(), }; } if (Array.isArray(response)) { return { data: response, }; } if (response instanceof Object) { if (returnUnwrappedObject) { return response; } return { text: JSON.stringify(response), }; } return { response: { text: response, }, }; } //# sourceMappingURL=responseFormatter.js.map