The current withCapability() method takes a function that constructs a Capability object who's properties are incrementally updated... This is a massive pain for frameworks like React that hate mutation.
Something like this might be easier to work with:
type InputDescription = {
type: "raw" | "image" | ... | "sound",
args: Record<string, number>,
};
type GetInputs = (InputDescription[]) => Tensor[];
class Builder {
...
// Set the function Rune will call when it wants inputs.
withInputs(getInputs: GetInputs): this { ... }
}
The current
withCapability()
method takes a function that constructs aCapability
object who's properties are incrementally updated... This is a massive pain for frameworks like React that hate mutation.Something like this might be easier to work with: