How to Generate Flashcards from Previous AI Responses Using GPT Actions in Node.js (Next.js)?

Hi everyone, :wave:

I’m working on a project where I want users to create flashcards based on previous AI responses using GPT actions in my Node.js (Next.js) backend. I was not sure if I can access to conversation history including ChatGPT responses.

Use Case:

  1. User: Define Dog

  2. ChatGPT: Dog = cute animal

  3. User: Generate flashcards

  4. ChatGPT:

[
  {
    "word": "dog",
    "definition": "cute animal"
  }
]

Requirements:

Command: generate flashcards

Backend: Node.js (Next.js)

Key Challenges:

:white_check_mark: How can I access the previous AI response when the user triggers the generate flashcards command?

I’d really appreciate any suggestions or code examples to help implement this. Thanks in advance for your insights! :pray:

You have to design the openapi definition in a way that the chat will understand that it can use them.

e.g. when you write in the description of the endpoint “when the user asks for a flashcard this endpoint needs to be triggered” and you must then also define how the parameters are expected by your API.