← Back to changelog
November 16, 2023
OpenAI SDK integration now supports v1.x and v0.x
Max Deichmann
OpenAI has released a major SDK update. The latest Langfuse integration now supports both the new and old versions, ensuring optimal backwards compatibility with other packages.
Minor improvement to the integration: environment variables can also be set as attributes on the openai
object.
# existing method
import os
os.environ["LANGFUSE_PUBLIC_KEY"] = "YOUR_PUBLIC_KEY"
os.environ["LANGFUSE_SECRET_KEY"] = "YOUR_SECRET_KEY"
from langfuse.openai import openai
# additional method
from langfuse.openai import openai
openai.langfuse_public_key = "YOUR_PUBLIC_KEY"
openai.langfuse_secret_key = "YOUR_SECRET_KEY"
See the OpenAI SDK integration page for more information.