import { OpenAI } from "@langchain/openai"; let totalCompletionTokens = 0; let totalPromptTokens = 0; let totalTokens = 0; const model = new OpenAI({ openAIApiKey: process.env.OPEN_AI_API_KEY, modelName: "gpt-3.5-turbo", callbacks: [ { handleLLMEnd(output) { console.log(JSON.stringify(output, null, 2)); totalCompletionTokens += output.llmOutput?.tokenUsage?.completionTokens ?? 0; totalPromptTokens