CLASSROOMIO-T-132: [BUG] WYSIWIG editing has wrong behavior

CLASSROOMIO-T-132: Final test & remove logs

CLASSROOMIO-T-132: Merge Fix (Tailwind Styling)

CLASSROOMIO-T-132: Merge Fix

Try out cl-editor

CLASSROOMIO-T-132: Experimental gpttyping + wysiwig implementation


Co-authored-by: Rotimi Best <[email protected]>
Co-authored-by: Tunji Adeyemi <[email protected]>


Merge-request: CLASSROOMIO-MR-58
Merged-by: Best Admin <[email protected]>
This commit is contained in:
Rotimi Best
2023-08-28 13:10:23 +00:00
committed by Space Cloud
co-authored by Rotimi Best Tunji Adeyemi
parent a3132371a1
commit 6a691d9fbd
5 changed files with 82 additions and 18 deletions
+1 -4
View File
@@ -22,19 +22,16 @@ const instruction = {
export async function POST({ request }) {
const { prompt } = await request.json();
const { courseTitle, lessonTitle, type } = prompt;
console.log('prompt', prompt);
console.time('debugOpenAi');
const response = await openai.createChatCompletion({
model: 'gpt-3.5-turbo',
messages: [
{
role: 'user',
content: `Generate a ${instruction[type]} given the course title is "${courseTitle}" and the lesson is "${lessonTitle}". Format in HTML without any styling, don't include the title of the course and title of the lesson in the result & make sure the content is well detailed.`
content: `Generate a ${instruction[type]} given the course title is "${courseTitle}" and the lesson is "${lessonTitle}". Format in HTML without any styling, no ul, ol or li tags, don't include the title of the course and title of the lesson in the result & make sure the content is well detailed.`
}
],
stream: true
});
console.timeEnd('debugOpenAi');
// Convert the response into a friendly text-stream
const stream = OpenAIStream(response);
// Respond with the stream