← Back to changelog
November 16, 2023

OpenAI SDK integration now supports v1.x and v0.x

Picture Max DeichmannMax 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.

Was this page useful?

Questions? We're here to help

Subscribe to updates