debugOpenAi
This commit is contained in:
@@ -23,7 +23,7 @@ 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: [
|
||||
@@ -34,7 +34,7 @@ export async function POST({ request }) {
|
||||
],
|
||||
stream: true
|
||||
});
|
||||
|
||||
console.timeEnd('debugOpenAi');
|
||||
// Convert the response into a friendly text-stream
|
||||
const stream = OpenAIStream(response);
|
||||
// Respond with the stream
|
||||
|
||||
Reference in New Issue
Block a user