github langfuse/langfuse-python v1.4.1
1.4.1

latest releases: v4.0.1, v4.0.0, v4.0.0b1...
2 years ago

Configure the langfuse connection via the openai integration.

from langfuse.openai import openai

openai.langfuse_public_key = 'public-key'
openai.langfuse_secret_key = 'secret-key'
openai.langfuse_host = 'host'

completion = openai.chat.completions.create(
  name="test-chat",
  model="gpt-3.5-turbo",
  messages=[
      {"role": "system", "content": "You are a very accurate calculator. You output only the result of the calculation."},
      {"role": "user", "content": "1 + 1 = "}],
  temperature=0,
  metadata={"someMetadataKey": "someValue"},
)

Don't miss a new langfuse-python release

NewReleases is sending notifications on new releases.