I think everything that's OpenAI-specific is inside modelProviders at this point, so we can get started adding more providers.
20 lines
351 B
TypeScript
20 lines
351 B
TypeScript
import "dotenv/config";
|
|
import { openai } from "../utils/openai";
|
|
|
|
const resp = await openai.chat.completions.create({
|
|
model: "gpt-3.5-turbo-0613",
|
|
stream: true,
|
|
messages: [
|
|
{
|
|
role: "user",
|
|
content: "count to 20",
|
|
},
|
|
],
|
|
});
|
|
|
|
for await (const part of resp) {
|
|
console.log("part", part);
|
|
}
|
|
|
|
console.log("final resp", resp);
|