I was having a lot of fun building chat gpt plugins and using them for my personal workflows. To help me rapidly prototype I built a script that asks GPT to write a plugin for me. It will create a template with node.js, typescript, and express for whatever topic you ask it to: Here is an example of a github plugin that it generated and I didn’t have to do any manual modifications.
I had used it with the following input: What is your project named?: recipe-generator What is the topic of your plugin for GPT to use for generation? A recipe generator that can take ingredients and cuisine as input and produce a recipe with detailed cooking instructions and a meal description that can be used to generate an image.
I had 2 plugins installed: the recipe generator (using your tool) and instacart (available in the plugin store). What is interesting is that GPT-4 asked if I wanted to order items in the recipe and then called the instacart plugin with a shopping list based on the recipe. I can point you to the github repo if you’re interested. I was surprised that based on the context, GPT chose to automatically invoke the instacart plugin.
@sawyer I tried and am getting this when generating the code:
Generating index.ts file...
/Users/me/.npm/_npx/a67ddc7a09eebd4d/node_modules/langchain/dist/util/axios-fetch-adapter.cjs:240
const headers = new Headers(config.headers);
^
ReferenceError: Headers is not defined
Sorry @cyberjunkie I was out on vacation so I didn’t see this. You need at least node 18 to use this utility. Let me update the package.json of the package!
hi,great job.
i cloned it to my computer, and after i ran, it shows:
/Users/liguanghe/.npm/_npx/a67ddc7a09eebd4d/node_modules/langchain/dist/util/axios-fetch-adapter.cjs:319
const error = new Error(message);
^
Error: Network Error
at createError (/Users/liguanghe/.npm/_npx/a67ddc7a09eebd4d/node_modules/langchain/dist/util/axios-fetch-adapter.cjs:319:19)
at getResponse (/Users/liguanghe/.npm/_npx/a67ddc7a09eebd4d/node_modules/langchain/dist/util/axios-fetch-adapter.cjs:196:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async fetchAdapter (/Users/liguanghe/.npm/_npx/a67ddc7a09eebd4d/node_modules/langchain/dist/util/axios-fetch-adapter.cjs:172:18) {
config: {
transitional: {
silentJSONParsing: true,
forcedJSONParsing: true,
clarifyTimeoutError: false
},
@AliceLee I wasn’t able to reproduce on MacOS also on node 20.1.0. Would it be possible that you selected the GPT4 option but your OpenAI account doesn’t have access to it yet?
HI~
i did what u tought me what to do, and it works~ amazing.
One more question,is there just for Front-end pages. Should i still need to write back-end script, like an sql to record for example? where i should put back-end script to?
Langdock does provide a similar capability, but it’s more extensive and comes with certain usage limits and costs. Whats cool about @sawyer npx command is it offers a quick and straightforward way to prototype ChatGPT plugins right in your development environment. This could be a better fit if you’re seeking a more lightweight and customizable solution.
On your frontend/backend question: The setup doesn’t include a traditional frontend. Instead, the command builds a “backend” application using Node.js, TypeScript, and Express, which processes requests and sends responses. This application communicates directly with the ChatGPT plugin API, which you can consider our interface in this context.
As for your SQL question, yes, you can absolutely integrate a database within your Express application. If you want to store some data (like queries or responses), you could write a SQL script that interacts with your chosen database (such as PostgreSQL or MySQL) directly within your Express routes. You can even ask ChatGPT itself about how to integrate SQL within an Express application.
BeigeOrca,
morning~
thanks a lot for teaching me these, i’ll try to use Node.js, TypeScript, and Express.
just for nice, have u submit this plugin to openai to review~? looking forward to meeting it on chatgpt~