hotg-ai / rune

Rune provides containers to encapsulate and deploy edgeML pipelines and applications
Apache License 2.0
134 stars 15 forks source link

Command for "rune inspect proc-block" #415

Closed Michael-F-Bryan closed 2 years ago

Michael-F-Bryan commented 2 years ago

This modifies the existing rune inspect command so when you point it at a crate's folder on disk it will compile the crate to WebAssembly and extract the proc-block metadata.

Here is an example of what you might get if you ask for JSON output:

$ cargo rune inspect ~/Documents/hotg-ai/proc-blocks/audio_float_conversion --format=json
{
  "type_name": "AudioFloatConversion",
  "description": "Convert a PCM audio clip from 16-bit signed integers to floats between 0 and\n1.",
  "available_transforms": [
    {
      "inputs": [
        {"element_type": "I16", "dimensions": "Arbitrary"}
      ],
      "outputs": [
        {"element_type": "F32", "dimensions": "Arbitrary"}
      ]
    }
  ]
}

$ cargo rune inspect ~/Documents/hotg-ai/proc-blocks/audio_float_conversion --format=text
AudioFloatConversion
--------------------
Convert a PCM audio clip from 16-bit signed integers to floats between 0 and
1.

Transforms:
  inputs: i16[..]
  outputs: f32[..]