Variable autogen.beta.annotations.Variable # Variable(real_name='', *, default=Ellipsis, default_factory=Ellipsis, cast=False) Bases: CustomField Source code in autogen/beta/annotations.py 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63def __init__( self, real_name: str = "", *, default: Any = Ellipsis, default_factory: Callable[[], Any] | EllipsisType = Ellipsis, cast: bool = False, ) -> None: self.name = real_name self.default = default self.default_factory = default_factory super().__init__( cast=cast, required=(default is Ellipsis), ) param_name instance-attribute # param_name name instance-attribute # name = real_name default instance-attribute # default = default default_factory instance-attribute # default_factory = default_factory use # use(**kwargs) Source code in autogen/beta/annotations.py 65 66 67 68 69 70 71 72 73 74def use(self, /, **kwargs: Any) -> dict[str, Any]: if ctx := kwargs.get(CONTEXT_OPTION_NAME): name = self.name or self.param_name if opt := ctx.variables.get(name): kwargs[self.param_name] = opt elif self.default is not Ellipsis: kwargs[self.param_name] = ctx.variables[name] = self.default elif self.default_factory is not Ellipsis: kwargs[self.param_name] = ctx.variables[name] = self.default_factory() return kwargs