Skip to content

Commit ed4f2e3

Browse files
authored
feat(client): add async api client (#1102)
1 parent 9497560 commit ed4f2e3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

langfuse/client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@
7171
import pydantic # type: ignore
7272

7373
from langfuse._task_manager.task_manager import TaskManager
74-
from langfuse.api.client import FernLangfuse
74+
from langfuse.api.client import AsyncFernLangfuse, FernLangfuse
7575
from langfuse.environment import get_common_release_envs
7676
from langfuse.logging import clean_logger
7777
from langfuse.media import LangfuseMedia
@@ -299,9 +299,19 @@ def __init__(
299299
httpx_client=self.httpx_client,
300300
timeout=timeout,
301301
)
302+
async_public_api_client = AsyncFernLangfuse(
303+
base_url=self.base_url,
304+
username=public_key,
305+
password=secret_key,
306+
x_langfuse_sdk_name="python",
307+
x_langfuse_sdk_version=version,
308+
x_langfuse_public_key=public_key,
309+
timeout=timeout,
310+
)
302311

303312
self.api = public_api_client
304313
self.client = public_api_client # legacy, to be removed in next major release
314+
self.async_api = async_public_api_client
305315

306316
langfuse_client = LangfuseClient(
307317
public_key=public_key,

0 commit comments

Comments
 (0)