Utils
Dependency Injection
Depends
Simple Dependency injection implementation similar to FastAPI.
Source code in germinate_ai/utils/di.py
get_io_schemas(func)
Get input and output schemas (Pydantic models) from the function signature.
Source code in germinate_ai/utils/di.py
resolve_dependencies(func, *args, **kwargs)
Returns bound arguments with dependencies resolved.
Source code in germinate_ai/utils/di.py
resolve_dependencies_wrapper(func)
Returns a function wrapper that binds func arguments, applies defaults and resolves any dependency injections.
Source code in germinate_ai/utils/di.py
Misc
get_next_tick(tick_interval)
Given a tick interval (in seconds), returns a function that gives the time to sleep until next tick based on the last tick timestamp.