Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,
)
Comment on lines +302 to +310
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: The async client is instantiated without an httpx_client, while the sync client uses the shared httpx_client. This could lead to connection pooling issues since the async client will create its own connection pool.


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
Loading