forked from phoenix/litellm-mirror
This reverts commit 8359cb6fa9
.
This commit is contained in:
parent
8359cb6fa9
commit
400cbff9ba
3 changed files with 8 additions and 98 deletions
|
@ -2801,10 +2801,14 @@ def get_standard_logging_metadata(
|
|||
)
|
||||
if isinstance(metadata, dict):
|
||||
# Filter the metadata dictionary to include only the specified keys
|
||||
supported_keys = StandardLoggingMetadata.__annotations__.keys()
|
||||
for key in supported_keys:
|
||||
if key in metadata:
|
||||
clean_metadata[key] = metadata[key] # type: ignore
|
||||
clean_metadata = StandardLoggingMetadata(
|
||||
**{ # type: ignore
|
||||
key: metadata[key]
|
||||
for key in StandardLoggingMetadata.__annotations__.keys()
|
||||
if key in metadata
|
||||
}
|
||||
)
|
||||
|
||||
if metadata.get("user_api_key") is not None:
|
||||
if is_valid_sha256_hash(str(metadata.get("user_api_key"))):
|
||||
clean_metadata["user_api_key_hash"] = metadata.get(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue