Extract AI response creation & retrieval logic from CreateAIReply
This will be reused in ListArticles, as it looks up transcripts and potentially creates one as AI replies.
createAIResponse creates an AI response in loading state and returns a callback . When transcript is done, calls the provided callback to update the AI response.
getAIResponse will try waiting for a loading AI Response if one exists.
coverage: 88.175% (+0.03%) from 88.141% when pulling 1501d53f31b1dbef390db481c93b8f2d26eaff74 on refactor-ai-resp into aa5e85f7a62bf8562d8aa92b39b9b6d3f1487871 on master.
Refactors
Extract AI response creation & retrieval logic from
CreateAIReply
ListArticles
, as it looks up transcripts and potentially creates one as AI replies.createAIResponse
creates an AI response in loading state and returns a callback . When transcript is done, calls the provided callback to update the AI response.getAIResponse
will try waiting for a loading AI Response if one exists.refactor(graphql): extract latest AI response retrieval logic to utility
refactor(CreateAIReply): extract AI Response creation and updating to util function