The OpenAI client instance to trace
Traced OpenAI client with tracing capabilities
const openai = new OpenAI({ apiKey: 'test-key' });
const wrappedOpenAI = tracedOpenAI(openai);
const response = await wrappedOpenAI.chat.completions.create({
messages: [{ role: 'user', content: 'Hello!' }],
model: 'gpt-4o-mini',
temperature: 0.5
});
// The trace for the LLM call will be logged to MLflow
Create a traced version of OpenAI client with MLflow tracing