Merge branch 'main' of https://gitee.com/wg123/video-gen
This commit is contained in:
@@ -55,6 +55,11 @@ def owner_type_of(owner: GenerationOwner) -> str:
|
|||||||
return GenerationOwnerType.CHAT_GENERATION_TASK.value
|
return GenerationOwnerType.CHAT_GENERATION_TASK.value
|
||||||
if isinstance(owner, GenerationRecord):
|
if isinstance(owner, GenerationRecord):
|
||||||
return GenerationOwnerType.GENERATION_RECORD.value
|
return GenerationOwnerType.GENERATION_RECORD.value
|
||||||
|
# 兼容 SimpleNamespace 快照(如 image_batch 的 task_snapshot)
|
||||||
|
if hasattr(owner, 'generation_mode'):
|
||||||
|
return GenerationOwnerType.CHAT_GENERATION_TASK.value
|
||||||
|
if hasattr(owner, 'include_media_references'):
|
||||||
|
return GenerationOwnerType.GENERATION_RECORD.value
|
||||||
raise TypeError(f"不支持的生成任务对象: {type(owner)!r}")
|
raise TypeError(f"不支持的生成任务对象: {type(owner)!r}")
|
||||||
|
|
||||||
|
|
||||||
@@ -67,6 +72,11 @@ def owner_include_media_references(owner: GenerationOwner) -> bool:
|
|||||||
return True
|
return True
|
||||||
if isinstance(owner, GenerationRecord):
|
if isinstance(owner, GenerationRecord):
|
||||||
return bool(owner.include_media_references)
|
return bool(owner.include_media_references)
|
||||||
|
# 兼容 SimpleNamespace 快照(如 image_batch 的 task_snapshot)
|
||||||
|
if hasattr(owner, 'generation_mode'):
|
||||||
|
return True
|
||||||
|
if hasattr(owner, 'include_media_references'):
|
||||||
|
return bool(owner.include_media_references)
|
||||||
raise TypeError(f"不支持的生成任务对象: {type(owner)!r}")
|
raise TypeError(f"不支持的生成任务对象: {type(owner)!r}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user