Skip to main content

Getting Started

After installing the Flora Engine package, a Flora Engine settings scriptable object will be required. Create one from the menu, Tools > Databiomes > Flora Engine > Setup to automatically generate the asset in the correct folder or create a Resources folder in you assets folder and use Assets > Create > Flora Engine > Settings to create your own instance of the settings. With the default settings Flora Engine will now be enabled and ready to use when the game is started. Place your Flora Engine model files under /Assets/StreamingAssets/Models/ in a subfolder with your model's name.

From your script you can then add using Databiomes.FloraEngine; to access Flora Engine functions. FloraRuntime.StartModel("your_model"); must first be used to initialize an instance of your model.

It is recommended to create an async function to handle infer calls to your model in the format:

async void Infer()
{
FloraOutput result = await FloraRuntime.AsyncInferModel("your_model", "Hello, world!", "StateMachineInstruction");

Debug.Log($"Flora output: {result.output}, reaction: {result.reaction}, token speed: {result.tokenSpeed}");
}