import OpenAI from "openai"

export const openai = new OpenAI({
    apiKey: process.env.OPENAI_API_KEY || "",
})


// Function to create a file with the Files API
export async function createFile(filePath: string) {
    const fileContent = Bun.file(filePath)
    const result = await openai.files.create({
        file: fileContent,
        purpose: "vision",
    })
    return result.id
}