debugOpenAi
This commit is contained in:
@@ -23,7 +23,7 @@ export async function POST({ request }) {
|
|||||||
const { prompt } = await request.json();
|
const { prompt } = await request.json();
|
||||||
const { courseTitle, lessonTitle, type } = prompt;
|
const { courseTitle, lessonTitle, type } = prompt;
|
||||||
console.log('prompt', prompt);
|
console.log('prompt', prompt);
|
||||||
|
console.time('debugOpenAi');
|
||||||
const response = await openai.createChatCompletion({
|
const response = await openai.createChatCompletion({
|
||||||
model: 'gpt-3.5-turbo',
|
model: 'gpt-3.5-turbo',
|
||||||
messages: [
|
messages: [
|
||||||
@@ -34,7 +34,7 @@ export async function POST({ request }) {
|
|||||||
],
|
],
|
||||||
stream: true
|
stream: true
|
||||||
});
|
});
|
||||||
|
console.timeEnd('debugOpenAi');
|
||||||
// Convert the response into a friendly text-stream
|
// Convert the response into a friendly text-stream
|
||||||
const stream = OpenAIStream(response);
|
const stream = OpenAIStream(response);
|
||||||
// Respond with the stream
|
// Respond with the stream
|
||||||
|
|||||||
Reference in New Issue
Block a user