langfuse / langfuse

🪢 Open source LLM engineering platform: LLM Observability, metrics, evals, prompt management, playground, datasets. Integrates with LlamaIndex, Langchain, OpenAI SDK, LiteLLM, and more. 🍊YC W23
https://langfuse.com/docs
Other
6.36k stars 615 forks source link

bug: _get_langfuse() does not exists anymore in v2.5 #3428

Closed ootkin closed 1 month ago

ootkin commented 1 month ago

Describe the bug

We followed your documentation in order to integrate langfuse with the OpenAI Assistant API, here: https://langfuse.com/docs/integrations/openai/python/assistants-api#3-getting-the-response

This morning we bumped from 2.48 to 2.50 and our app stopped working.

After some dig in, we saw that _get_langfuse() has been replaced with client_instance() (i think): https://github.com/langfuse/langfuse-python/compare/v2.49.0...v2.50.0

I know that only for the integration with OpenAI Assistant we had to use a private method and this is a minor, but the documentation is out of date.

To reproduce

Install v2.58 and try to:

from langfuse.decorators import langfuse_context

langfuse_client = langfuse_context._get_langfuse()

SDK and container versions

python v2.48

Additional information

No response

Are you interested to contribute a fix for this bug?

No

ootkin commented 1 month ago

This is the PR: https://github.com/langfuse/langfuse-python/pull/932

@hassiebp

marcklingen commented 1 month ago

thanks for sharing!

hassiebp commented 1 month ago

Thanks a lot! Updated the docs as part of this PR: https://github.com/langfuse/langfuse-docs/pull/817

alexcannan commented 1 month ago

Just chiming in to say this issue also affected me. Since .client_instance is no longer preceded by an underscore, does mean that it will be accessible in perpetuity? (withholding major version changes)

hassiebp commented 1 month ago

@alexcannan Yes 👍🏾