This commit is contained in:
SurenderguliaEnginner 2026-11-01 03:41:26 +08:00 • committed by GitHub
commit b5f32f3689
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View file

@ -159,8 +159,12 @@ class ManagedObjectCreatorAttribution:
async def batch_metadata(self, job: ManagedObjectRow, object_id: str) -> Mapping[str, object]:
rows: Final = await self._rows(job, object_id)
return {"user_api_key_user_id": job.created_by, **_shared_metadata(job, rows)}
end_user_id: Final = getattr(job, "end_user_id", None)
return {
"user_api_key_user_id": job.created_by,
**_shared_metadata(job, rows),
**({"user_api_key_end_user_id": end_user_id} if end_user_id else {}),
}
async def response_creator(self, job: ManagedObjectRow, object_id: str) -> ResponseCreator:
try:
return await self._read_response_creator(job, object_id)

View file

@ -782,7 +782,7 @@ class _PROXY_LiteLLMManagedFiles(CustomLogger, BaseFileEndpoints):
from prisma import Json
api_key = LiteLLMProxyRequestSetup.get_logged_api_key(user_api_key_dict) or None
end_user_id: Final = user_api_key_dict.end_user_id if file_purpose == "response" else None
end_user_id: Final = user_api_key_dict.end_user_id if file_purpose in ["response", "batch"] else None
attribution_columns = (
{
**({"api_key": api_key} if api_key is not None else {}),