Project

General

Profile

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.

Status:
Closed
Priority:
High
Target version:
Start date:
06/20/2023
Due date:
06/23/2023
% Done:

100%

Estimated time:
2.00 h
Spent time:

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.

#1

Updated by Md Shahzar over 1 year ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 70
#2

Updated by Md Shahzar over 1 year ago

  • % Done changed from 70 to 100
#3

Updated by Md Shahzar over 1 year ago

  • Status changed from In Progress to Resolved
#4

Updated by Ayush Khandelwal over 1 year ago

  • Status changed from Resolved to Reopened
  • % Done changed from 100 to 50
#5

Updated by Md Shahzar over 1 year ago

  • Status changed from Reopened to In Progress
#6

Updated by Md Shahzar over 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
#7

Updated by Md Shahzar over 1 year ago

  • Status changed from Resolved to Review
#8

Updated by Md Shahzar over 1 year ago

  • Assignee changed from Md Shahzar to Ayush Khandelwal
#9

Updated by Ayush Khandelwal over 1 year ago

MR looks good

#10

Updated by Ayush Khandelwal over 1 year ago

  • Status changed from Review to Feedback
  • Assignee changed from Ayush Khandelwal to Md Shahzar
#11

Updated by Md Shahzar over 1 year ago

  • Assignee changed from Md Shahzar to Ayush Khandelwal
#12

Updated by Md Shahzar over 1 year ago

  • Status changed from Feedback to Reopened
  • Assignee changed from Ayush Khandelwal to Md Shahzar
#13

Updated by Md Shahzar over 1 year ago

  • Status changed from Reopened to In Progress
#14

Updated by Md Shahzar over 1 year ago

  • Status changed from In Progress to Resolved
#15

Updated by Md Shahzar over 1 year ago

  • Status changed from Resolved to Review
  • Assignee changed from Md Shahzar to Ayush Khandelwal
#16

Updated by Ayush Khandelwal over 1 year ago

  • 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.

#17

Updated by Md Shahzar over 1 year ago

  • Status changed from Reopened to In Progress
#18

Updated by Ayush Khandelwal over 1 year ago

Review points:
  1. Handle the openai error separately instead of catching it through null pointer exception.
  2. Log the openai error as a severe log level.
  3. Add the ticket number to the title of the merge request.
#19

Updated by Md Shahzar over 1 year ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100
#20

Updated by Md Shahzar over 1 year ago

  • Status changed from Resolved to Review
  • Assignee changed from Md Shahzar to Ayush Khandelwal
#21

Updated by Ayush Khandelwal over 1 year ago

  • Status changed from Review to Feedback
  • Assignee changed from Ayush Khandelwal to Md Shahzar
#22

Updated by Md Shahzar over 1 year ago

  • Assignee changed from Md Shahzar to Ayush Khandelwal
#23

Updated by Ayush Khandelwal over 1 year ago

  • Status changed from Feedback to Closed

Working as expected

Also available in: Atom PDF