interface output-text {
// Import pollable functionality from the WASI IO poll package
use wasi:io/poll@0.2.4.{pollable};
use core.{queue};
use allocate.{object-id}; // Import object ID type for memory references
// Computes the next-token distribution from the given embedding IDs
get-next-token-distribution: func(
queue: borrow<queue>,
emb-ids: list<object-id> // Embedding IDs to base the prediction on
) -> distribution-result;
// Result of a token distribution computation (may be asynchronous)
resource distribution-result {
// Returns a pollable object to check when the result is ready
pollable: func() -> pollable;
// Retrieves the result if ready; None if still pending
// Each tuple: (token IDs, associated probabilities)
get: func() -> option<list<tuple<list<u32>, list<f32>>>>;
}
}