mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-21 00:21:49 +00:00
refactor(batches): annotate the stored file row so its model import is a real use
This commit is contained in:
parent
9f0eb5082a
commit
020cbba4dd
1 changed files with 4 additions and 2 deletions
|
|
@ -3,7 +3,7 @@ from typing import TYPE_CHECKING, Final
|
|||
from litellm.repositories.table_repositories import PrismaTableRepository
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from prisma import models as prisma_models # noqa: F401 # used by the quoted base-class subscript
|
||||
from prisma import models as prisma_models
|
||||
|
||||
|
||||
class ManagedFileContentRepository(PrismaTableRepository["prisma_models.LiteLLM_ManagedFileContentTable"]):
|
||||
|
|
@ -18,7 +18,9 @@ class ManagedFileContentRepository(PrismaTableRepository["prisma_models.LiteLLM_
|
|||
return row.id
|
||||
|
||||
async def load(self, row_id: str) -> bytes | None:
|
||||
row: Final = await self.table.find_unique(where={"id": row_id}) # mutable-ok: prisma filters are plain dicts
|
||||
row: Final[prisma_models.LiteLLM_ManagedFileContentTable | None] = await self.table.find_unique(
|
||||
where={"id": row_id} # mutable-ok: prisma filters are plain dicts
|
||||
)
|
||||
return None if row is None else row.content.decode()
|
||||
|
||||
async def delete(self, row_id: str) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue