Hi Dariel, All I did was convert my long operation to queue-based endpoint, and added an end-point to check the queue status. ChatGPT figured out the rest by itself, here’s my openapi.yaml file
openapi: 3.0.1
info:
title: Summarizer Plugin
description: A plugin that allows the user to summarize artiles, podcasts, YouTube videos and pdfs using ChatGPT. If you do not know the user's inBrief api key, ask them first before making queries to the plugin. Otherwise, use the api key "trial".
version: 'v1'
servers:
- url: https://chatgpt-plugin.inbrief.ai
paths:
/api/get-queue-status:
get:
operationId: getQueueStatus
summary: Get the status and summary of a summarization task
description: This endpoint retrieves the status and summary (if the task is finished) of a summarization task based on the provided queue ID.
parameters:
- in: query
name: queueID
description: The queue ID of the summarization task
required: true
schema:
type: string
responses:
'200':
description: Successfully retrieved the status and summary of the summarization task
content:
application/json:
schema:
$ref: '#/components/schemas/summarizeResponse'
'400':
description: Bad request (e.g., missing or invalid queue ID)
'404':
description: Queue ID not found
'500':
description: Internal server error
/api/summarize-queue:
post:
operationId: summarize
summary: Queues a new summarization task for a given URL and provides a queue ID
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/summarizeRequest'
responses:
"200":
description: OK
content:
application/json:
schema:
$ref: '#/components/schemas/queue'
components:
schemas:
summarizeResponse:
type: object
properties:
status:
type: string
description: Status of the summary request, 'in-progress', 'failed' or 'done'
required: true
title:
type: string
description: Title of the document summarized
required: true
nullable: true
summary:
type: string
description: The AI-generated summary of the URL
required: true
nullable: true
systemMessage:
type: string
description: A message from the system that is not a summary
required: false
nullable: true
queue:
type: object
properties:
status:
type: string
description: Status of the summary request, 'in-progress', 'failed' or 'queued'
required: true
queueID:
type: string
description: Title of the document summarized
required: true
nullable: true
systemMessage:
type: string
description: A message from the system that is not a summary
required: false
nullable: true
summarizeRequest:
type: object
required:
- url
properties:
url:
type: string
description: The URL of article / pdf / YouTube video you want to summarize
required: true
queueRequest:
type: object
required:
- queueID
properties:
queueID:
type: string
description: The queue ID of the summarization task
required: true