Skip to content

Commit b11bbcd

Browse files
authored
feat: generalize sdk_integration to string (#282)
1 parent af4e337 commit b11bbcd

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

langfuse/callback.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
from langfuse.api.resources.ingestion.types.sdk_log_event import SdkLogEvent
1111
from langfuse.client import (
1212
Langfuse,
13-
SDKIntegrationTypes,
1413
StatefulSpanClient,
1514
StatefulTraceClient,
1615
StateType,
@@ -124,7 +123,7 @@ def __init__(
124123
if timeout is not None:
125124
args["timeout"] = timeout
126125

127-
args["sdk_integration"] = SDKIntegrationTypes.LANGCHAIN
126+
args["sdk_integration"] = "langchain"
128127

129128
self.langfuse = Langfuse(**args)
130129
self.trace = None

langfuse/client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def __init__(
6868
flush_interval: int = 0.5,
6969
max_retries=3,
7070
timeout=15,
71-
sdk_integration: SDKIntegrationTypes = SDKIntegrationTypes.DEFAULT,
71+
sdk_integration: str = "default",
7272
):
7373
set_debug = debug if debug else (os.getenv("LANGFUSE_DEBUG", "False") == "True")
7474

@@ -130,7 +130,7 @@ def __init__(
130130
"public_key": public_key,
131131
"sdk_name": "python",
132132
"sdk_version": version,
133-
"sdk_integration": sdk_integration.value,
133+
"sdk_integration": sdk_integration,
134134
}
135135

136136
if threads is not None:

langfuse/openai.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from wrapt import wrap_function_wrapper
1010

1111
from langfuse import Langfuse
12-
from langfuse.client import SDKIntegrationTypes, StatefulGenerationClient
12+
from langfuse.client import StatefulGenerationClient
1313
from langfuse.utils import _get_timestamp
1414

1515
log = logging.getLogger("langfuse")
@@ -435,7 +435,7 @@ def initialize(self):
435435
secret_key=openai.langfuse_secret_key,
436436
host=openai.langfuse_host,
437437
debug=openai.langfuse_debug,
438-
sdk_integration=SDKIntegrationTypes.OPENAI,
438+
sdk_integration="openai",
439439
)
440440
return self._langfuse
441441

0 commit comments

Comments
 (0)