mlflow-openai
    Preparing search index...

    Function tracedOpenAI

    • Create a traced version of OpenAI client with MLflow tracing

      Type Parameters

      • T = any

      Parameters

      • openaiClient: T

        The OpenAI client instance to trace

      Returns T

      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