Add POST
endpoints for excerpt and title generation
#501
Labels
help wanted
Extra attention is needed
needs:engineering
This requires engineering to resolve.
type:enhancement
New feature or request.
Milestone
Is your enhancement related to a problem? Please describe.
For both our excerpt and title generation features, we added custom REST endpoints that are used when those features are requested (when the
Generate excerpt
orGenerate titles
buttons are clicked, for instance). These endpoints are set up asGET
endpoints and we pass in the current post ID. We then pull the content from that matches that post ID and send that along to ChatGPT.While this works, the problem here is if you try to use one of these features on an item using the Block Editor that hasn't been saved yet, the content that we send to ChatGPT will be whatever was previously saved (if any). This means if you're working on a post that hasn't been saved yet, no content will be sent. Or if you've made a bunch of edits but haven't saved them yet, the old content will be sent.
I think it's fine to leave these
GET
endpoints alone but we should investigate addingPOST
endpoints as well and changing our functionality to pass in the full content of a post instead of just a post ID. This will require aPOST
endpoint as we'll probably run into content length issues if we try and use aGET
endpoint for this (as it sets all the content in the URL instead of thebody
).So at an overview, here's what I'd see needs to be done:
POST
endpoints for both excerpt and title generationbody
, or maybe two params, one for post content and one for post titleGET
endpointDesigns
No response
Describe alternatives you've considered
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: