Skip to content

create_model_ref

fastagency.studio.helpers.create_model_ref async #

create_model_ref(
    cls: type[T],
    type_name: str,
    user_uuid: Union[str, UUID],
    background_tasks: Optional[BackgroundTasks] = None,
    **kwargs: Any
) -> ObjectReference
Source code in fastagency/studio/helpers.py
async def create_model_ref(
    cls: type[T],
    type_name: str,
    user_uuid: Union[str, UUID],
    background_tasks: Optional[BackgroundTasks] = None,
    **kwargs: Any,
) -> ObjectReference:
    model_uuid, _ = await create_model(
        cls,
        type_name,
        user_uuid,
        background_tasks,
        **kwargs,
    )

    model_ref = cls.get_reference_model()(uuid=model_uuid)

    return model_ref