Skip to content

Commit

Permalink
feat(client): add async api client (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
hassiebp authored Feb 5, 2025
1 parent 9497560 commit ed4f2e3
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion langfuse/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
import pydantic # type: ignore

from langfuse._task_manager.task_manager import TaskManager
from langfuse.api.client import FernLangfuse
from langfuse.api.client import AsyncFernLangfuse, FernLangfuse
from langfuse.environment import get_common_release_envs
from langfuse.logging import clean_logger
from langfuse.media import LangfuseMedia
Expand Down Expand Up @@ -299,9 +299,19 @@ def __init__(
httpx_client=self.httpx_client,
timeout=timeout,
)
async_public_api_client = AsyncFernLangfuse(
base_url=self.base_url,
username=public_key,
password=secret_key,
x_langfuse_sdk_name="python",
x_langfuse_sdk_version=version,
x_langfuse_public_key=public_key,
timeout=timeout,
)

self.api = public_api_client
self.client = public_api_client # legacy, to be removed in next major release
self.async_api = async_public_api_client

langfuse_client = LangfuseClient(
public_key=public_key,
Expand Down

0 comments on commit ed4f2e3

Please sign in to comment.