Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set default input/output in Langfuse integration #3563

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

dougzor
Copy link

@dougzor dougzor commented May 10, 2024

We hit a scenario in our production system when getting a Prompt from the langfuse API where the Prompt didn't exist:

langfuse.api.resources.commons.errors.not_found_error.NotFoundError: status_code: 404, body: {'message': "No production-labeled prompt found with name <prompt_name_redacted> in project <project_id_redacted>, 'error': 'LangfuseNotFoundError'}

which then caused
UnboundLocalError: cannot access local variable 'output' where it is not associated with a value print_verbose(f"OUTPUT IN LANGFUSE: {output}; original: {response_obj}") File "/app/.venv/lib/python3.12/site-packages/litellm/integrations/langfuse.py", line 149, in log_event

This PR at least attempts to set a sensible default so that an error like this cannot happen.

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 10, 2024 2:01pm

@krrishdholakia
Copy link
Contributor

hey @dougzor can you add a test here -

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants