Skip to content

Inference effect: embed operation (Array<Float64> vector embeddings) #371

@aallan

Description

@aallan

The <Inference> effect currently only exposes complete(String -> Result<String, String>). The embed operation — returning a vector embedding as Result<Array<Float64>, String> — was deferred from v0.0.101 because it requires heap allocation infrastructure for float arrays.

Scope

effect Inference {
  op complete(String -> Result<String, String>);
  op embed(String -> Result<Array<Float64>, String>);
}

The main blocker is returning a heap-allocated Array<Float64> from a WASM host import. The existing Result<String, String> pattern uses _alloc_result_ok_string; a parallel _alloc_result_ok_float_array helper is needed.

Providers

  • Anthropic: text-embedding-3-small / text-embedding-3-large via the embeddings endpoint
  • OpenAI: text-embedding-3-small (same API shape)
  • Moonshot: TBD

Related

Deferred from #61 (v0.0.101).

Metadata

Metadata

Assignees

No one assigned

    Labels

    blockedCannot be addressed until a dependency lands; see Relationships panelenhancementNew feature or requestlimitationKnown compilation limitation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions