Strategy
forge.strategyclassSince Forge API 1
Signaturepython
forge.strategy.Strategy(**values: Any) -> NoneOne strategy class per file, with FORGE_API = 1 at the top of the file.
Parameters
| Name | Type |
|---|---|
| **values | Any |
Members
| Name | Signature | Summary |
|---|---|---|
| describe | () -> dict[str, Any] | The machine description of this strategy's settings. |
| read_asset | (self, path: str) -> bytes | Return a bundled asset's bytes. The path is one listed in assets. |
| to_spec | () -> dict[str, Any] | Returns this strategy as a Strategy Spec when it uses only what the Studio can show. |
Declare each setting with fg.param as a class attribute, and write only the
hooks the strategy needs. setup(self, ctx) holds start-up code and may raise
fg.InvalidParams to reject a combination of settings.