@viviedu/applet-sdk
    Preparing search index...

    Class EdgeAi

    The edgeAi namespace on a BoxApplet. Talks directly to the box over HTTP. Obtained via applet.edgeAi.

    Index

    Methods

    • Encode an image on the box for model, returning an ImageEmbeddingRef to reuse across prompts. The ref is only valid for model.

      Parameters

      • model: Model
      • image: ImageBytes
      • Optionaloptions: { abortSignal?: AbortSignal }

      Returns Promise<ImageEmbeddingRef>

    • Load a model onto the box (starts/keeps it resident). Rejects if it fails.

      Parameters

      Returns Promise<void>

    • Run a one-shot prompt against a loaded model and return the full response.

      Parameters

      • model: Model
      • prompt: string
      • Optionaloptions: PromptOptions

      Returns Promise<string>

    • Run a prompt and stream the generated tokens as they arrive (SSE).

      Parameters

      • model: Model
      • prompt: string
      • Optionaloptions: Omit<PromptOptions, "abortSignal">

      Returns PromptStream

    • Create a EdgeAi instance.

      If the feature is not enabled or the info is undefined then a stub is returned that will error.

      TODO IGNT-895: Make sure the returned stub properly returns an error state

      Parameters

      • featureEnabled: boolean
      • info: UndefinedToOptional<{ token: string; url: string }> | undefined
      • logger: Logger

      Returns EdgeAi