Task #3074
Feature #3024: extension 0.92.20 & 0.93: Enable OpenAI answers
Feature #3061: Backend requirements
BE-0.92.20: Allow caching to the OpenAI encrypted secret key.
Added by Ayush Khandelwal over 1 year ago.
Updated over 1 year ago.
Description
1. Go to the login page, https://edutestqa.appspot.com/admin/login
2. Login through 'Admin' role user.
3. Go to the settings page for OpenAI, https://edutestqa.appspot.com/admin/qnageneration/settings#openAiAnswerConfigForm
4. When we put the secret key, 'something' and then click on 'Set'. It will go & saved into the datastore.
At the time of calling the OpenAI Answer API, it will fetch the secret key from the datastore every time. It will increase the load time. So in order to make it efficient, we have to apply the caching to the openai secret key.
Scheme:
1. If the secret key is newly added then cache it on the server.
2. If someone changed the secret key then update the caching for the secret key.
3. If the secret key is present in the caching then load it from the caching instead of doing the datastore call.
Open AI API Endpoints:
URL: http://edutestqa.appspot.com/admin/content/api/v1/answer
Method: "POST"
Request Body: (application/json) {
"searchTerm": "Once upon a time"
}
Overview of the API:
If api is enabled & the key is present, then it will give the response from openai. If not then it will return 512 words lorem ipsum.
- Status changed from New to In Progress
- % Done changed from 0 to 70
- % Done changed from 70 to 100
- Status changed from In Progress to Resolved
- Status changed from Resolved to Reopened
- % Done changed from 100 to 50
- Status changed from Reopened to In Progress
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
- Status changed from Resolved to Review
- Assignee changed from Md Shahzar to Ayush Khandelwal
- Status changed from Review to Feedback
- Assignee changed from Ayush Khandelwal to Md Shahzar
- Assignee changed from Md Shahzar to Ayush Khandelwal
- Status changed from Feedback to Reopened
- Assignee changed from Ayush Khandelwal to Md Shahzar
- Status changed from Reopened to In Progress
- Status changed from In Progress to Resolved
- Status changed from Resolved to Review
- Assignee changed from Md Shahzar to Ayush Khandelwal
- Status changed from Review to Reopened
- Assignee changed from Ayush Khandelwal to Md Shahzar
- % Done changed from 100 to 50
MR having some review points.
- Status changed from Reopened to In Progress
Review points:
- Handle the openai error separately instead of catching it through null pointer exception.
- Log the openai error as a severe log level.
- Add the ticket number to the title of the merge request.
- Status changed from In Progress to Resolved
- % Done changed from 50 to 100
- Status changed from Resolved to Review
- Assignee changed from Md Shahzar to Ayush Khandelwal
- Status changed from Review to Feedback
- Assignee changed from Ayush Khandelwal to Md Shahzar
- Assignee changed from Md Shahzar to Ayush Khandelwal
- Status changed from Feedback to Closed
Also available in: Atom
PDF