refactor: add explicit types to asset service functions

- Add typed result dataclasses: IngestResult, AddTagsResult,
  RemoveTagsResult, SetTagsResult, TagUsage
- Add UserMetadata type alias for user_metadata parameters
- Type helper functions with Session parameters
- Use TypedDicts at query layer to avoid circular imports
- Update manager.py and tests to use attribute access

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Luke Mino-Altherr
2026-02-03 20:32:14 -08:00
parent 37ecc5b663
commit 9290e26e9f
10 changed files with 184 additions and 125 deletions

View File

@@ -8,6 +8,18 @@ from app.assets.services.ingest import (
ingest_file_from_path,
register_existing_asset,
)
from app.assets.services.schemas import (
AddTagsResult,
AssetData,
AssetDetailResult,
AssetInfoData,
IngestResult,
RegisterAssetResult,
RemoveTagsResult,
SetTagsResult,
TagUsage,
UserMetadata,
)
from app.assets.services.tagging import (
apply_tags,
list_tags,
@@ -24,4 +36,14 @@ __all__ = [
"apply_tags",
"remove_tags",
"list_tags",
"AddTagsResult",
"AssetData",
"AssetDetailResult",
"AssetInfoData",
"IngestResult",
"RegisterAssetResult",
"RemoveTagsResult",
"SetTagsResult",
"TagUsage",
"UserMetadata",
]