Skip to content

Instantly share code, notes, and snippets.

@mst0wsk1
mst0wsk1 / encoder.js
Created June 16, 2023 04:09 — forked from iceener/encoder.js
gpt-3-encoder-netlify-function.js
const { encode } = require('@nem035/gpt-3-encoder')
exports.handler = async (event, context) => {
if (event.httpMethod === 'POST') {
try {
const payload = JSON.parse(event.body);
const text = payload.text;
return {