1818import os
1919import threading
2020from queue import Full , Queue
21- from typing import Dict , Optional , cast , Any
21+ from typing import Any , Dict , Optional , cast
2222
2323import httpx
2424from opentelemetry import trace as otel_trace_api
4343from langfuse ._utils .request import LangfuseClient
4444from langfuse .api .client import AsyncFernLangfuse , FernLangfuse
4545from langfuse .logger import langfuse_logger
46+ from langfuse .types import MaskFunction
4647
4748from ..version import __version__ as langfuse_version
4849
@@ -90,6 +91,7 @@ def __new__(
9091 httpx_client : Optional [httpx .Client ] = None ,
9192 media_upload_thread_count : Optional [int ] = None ,
9293 sample_rate : Optional [float ] = None ,
94+ mask : Optional [MaskFunction ] = None ,
9395 ) -> "LangfuseResourceManager" :
9496 if public_key in cls ._instances :
9597 return cls ._instances [public_key ]
@@ -110,6 +112,7 @@ def __new__(
110112 httpx_client = httpx_client ,
111113 media_upload_thread_count = media_upload_thread_count ,
112114 sample_rate = sample_rate ,
115+ mask = mask ,
113116 )
114117
115118 cls ._instances [public_key ] = instance
@@ -130,8 +133,10 @@ def _initialize_instance(
130133 media_upload_thread_count : Optional [int ] = None ,
131134 httpx_client : Optional [httpx .Client ] = None ,
132135 sample_rate : Optional [float ] = None ,
136+ mask : Optional [MaskFunction ] = None ,
133137 ):
134138 self .public_key = public_key
139+ self .mask = mask
135140
136141 # OTEL Tracer
137142 tracer_provider = _init_tracer_provider (
0 commit comments