forked from phoenix/litellm-mirror
Merge pull request #2516 from marcklingen/patch-1
Add langfuse `sdk_integration`
This commit is contained in:
commit
1588453532
1 changed files with 14 additions and 8 deletions
|
@ -27,14 +27,20 @@ class LangFuseLogger:
|
||||||
self.langfuse_host = os.getenv("LANGFUSE_HOST", "https://cloud.langfuse.com")
|
self.langfuse_host = os.getenv("LANGFUSE_HOST", "https://cloud.langfuse.com")
|
||||||
self.langfuse_release = os.getenv("LANGFUSE_RELEASE")
|
self.langfuse_release = os.getenv("LANGFUSE_RELEASE")
|
||||||
self.langfuse_debug = os.getenv("LANGFUSE_DEBUG")
|
self.langfuse_debug = os.getenv("LANGFUSE_DEBUG")
|
||||||
self.Langfuse = Langfuse(
|
|
||||||
public_key=self.public_key,
|
parameters = {
|
||||||
secret_key=self.secret_key,
|
"public_key": self.public_key,
|
||||||
host=self.langfuse_host,
|
"secret_key": self.secret_key,
|
||||||
release=self.langfuse_release,
|
"host": self.langfuse_host,
|
||||||
debug=self.langfuse_debug,
|
"release": self.langfuse_release,
|
||||||
flush_interval=flush_interval, # flush interval in seconds
|
"debug": self.langfuse_debug,
|
||||||
)
|
"flush_interval": flush_interval, # flush interval in seconds
|
||||||
|
}
|
||||||
|
|
||||||
|
if Version(langfuse.version.__version__) >= Version("2.6.0"):
|
||||||
|
parameters["sdk_integration"] = "litellm"
|
||||||
|
|
||||||
|
self.Langfuse = Langfuse(**parameters)
|
||||||
|
|
||||||
# set the current langfuse project id in the environ
|
# set the current langfuse project id in the environ
|
||||||
# this is used by Alerting to link to the correct project
|
# this is used by Alerting to link to the correct project
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue