langfuse / langfuse-python

🪢 Langfuse Python SDK - Instrument your LLM app with decorators or low-level SDK and get detailed tracing/observability. Works with any LLM or framework
https://langfuse.com/docs/sdk/python
MIT License
81 stars 86 forks source link

Amazon Bedrock and Authropic Claude issue with indenting model_name #133

Closed kobrinartem closed 10 months ago

kobrinartem commented 11 months ago

How to set model name so that LangFuse can get it. I have errors:

'model_name' Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/langfuse/callback.py", line 479, in __on_llm_action model_name = kwargs["invocation_params"]["model_name"] KeyError: 'model_name' run not found Traceback (most recent call last): File "/opt/conda/lib/python3.10/site-packages/langfuse/callback.py", line 541, in on_llm_end raise Exception("run not found") Exception: run not found

kobrinartem commented 11 months ago

quick fix: https://github.com/langfuse/langfuse-python/pull/134

maxdeichmann commented 10 months ago

@kobrinartem thanks for the contribution. PR is merged and deployed in 1.1.9. Please re-open in case of issues.