Performance issues when fetching prompts via python SDK in async mode #4539
-
Hey guys, I recently wanted to use Langfuse in Async mode and stumbled across I wanted to use it but I am unsure how to. I have a self-hosted Langfuse instance on Azure. This is the code: from langfuse.api.client import AsyncFernLangfuse
@observe()
async def get_system_prompt(name: str, prompt_type: Optional[str] = None):
langfuse = AsyncFernLangfuse(
x_langfuse_public_key=settings.LANGFUSE_PUBLIC_KEY,
base_url=settings.LANGFUSE_HOST,
)
try:
return await langfuse.prompts.get(name)
except Exception as err:
raise Exception(err) I always get an unauthorized error. Since the client also has username and password attributes, I don't know where to obtain them since using my email and password didn't work.
Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
To resolve the unauthorized error when using the
You can obtain these API keys in the project settings of your Langfuse instance. Ensure you use these credentials when making requests to your self-hosted Langfuse instance. Additionally, if you are setting up your instance for the first time, you can use the |
Beta Was this translation helpful? Give feedback.
-
This is an SDK client used within the Langfuse SDK and is not an interface intended for standalone use. The Langfuse get prompt should return the prompt immediately, allowing it to run in asynchronous applications without requiring async functionality. Let me know if you have any questions or concerns. |
Beta Was this translation helpful? Give feedback.
This is an SDK client used within the Langfuse SDK and is not an interface intended for standalone use.
The Langfuse get prompt should return the prompt immediately, allowing it to run in asynchronous applications without requiring async functionality. Let me know if you have any questions or concerns.