with_requirements

with_requirements(python_packages: list[str] = [], global_imports: list[str | autogen.coding.func_with_reqs.ImportFromModule | autogen.coding.func_with_reqs.Alias] = []) -> Callable[[Callable[~P, ~T]], autogen.coding.func_with_reqs.FunctionWithRequirements[~T, ~P]]

Decorate a function with package and import requirements

Parameters:
NameDescription
python_packagesPackages required to function.

Can include version info..

Defaults to [].

Type: list[str]

Default: []
global_importsRequired imports.

Defaults to [].

Type: list[str | autogen.coding.func_with_reqs.ImportFromModule | autogen.coding.func_with_reqs.Alias]

Default: []
Returns:
TypeDescription
Callable[[Callable[~P, ~T]], autogen.coding.func_with_reqs.FunctionWithRequirements[~T, ~P]]Callable[[Callable[P, T]], FunctionWithRequirements[T, P]]: The decorated function