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

feat(proxy_server.py): allow admin to return rejected response as string to user #3740

Merged
merged 4 commits into from
May 21, 2024

Conversation

krrishdholakia
Copy link
Contributor

@krrishdholakia krrishdholakia commented May 20, 2024

Title

Allows admin to return rejected request from pre-call hook as a response to user (instead of exception) for chat completion + text completion calls
Screenshot 2024-05-20 at 12 32 55 PM

Relevant issues

Closes #3671

Type

🆕 New Feature
🧹 Refactoring

Changes

  • allows pre_call_hooks to return a string response
  • adds overrides for chat completion + text completion calls for returning response in expected format

[REQUIRED] Testing - Attach a screenshot of any new tests passing locall

If UI changes, send a screenshot/GIF of working UI fixes

Tested on chat completions + completions streaming and non-streaming calls

Screenshot 2024-05-20 at 12 33 46 PM

cc: @Venukiran004

Copy link

vercel bot commented May 20, 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 20, 2024 7:48pm

…ith error logging

log the rejected request as a failed call to langfuse/slack alerting
@krrishdholakia krrishdholakia merged commit c6bb6e3 into main May 21, 2024
8 checks passed
@krrishdholakia krrishdholakia deleted the litellm_return_rejected_response branch May 21, 2024 00:48
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.

[Feature]: Custom response instead of HTTPException in precall hooks
1 participant