mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-08 03:08:45 +00:00
Merge pull request #4 from Noma-Security/feature/litellm-key-name-to-noma-app-id
Feature/litellm key name to noma app
This commit is contained in:
commit
a3e86237a8
1 changed files with 5 additions and 2 deletions
|
|
@ -116,8 +116,9 @@ class NomaGuardrail(CustomGuardrail):
|
|||
"NOMA_API_BASE", NomaGuardrail._DEFAULT_API_BASE
|
||||
)
|
||||
self.application_id = application_id or os.environ.get(
|
||||
"NOMA_APPLICATION_ID", "litellm"
|
||||
"NOMA_APPLICATION_ID"
|
||||
)
|
||||
self.default_application_id = "litellm"
|
||||
|
||||
if monitor_mode is None:
|
||||
self.monitor_mode = (
|
||||
|
|
@ -799,7 +800,9 @@ class NomaGuardrail(CustomGuardrail):
|
|||
or request_data.get("metadata", {})
|
||||
.get("headers", {})
|
||||
.get("x-noma-application-id")
|
||||
or self.application_id,
|
||||
or self.application_id
|
||||
or user_auth.key_alias
|
||||
or self.default_application_id,
|
||||
"ipAddress": request_data.get("metadata", {}).get(
|
||||
"requester_ip_address", None
|
||||
),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue