Minga.Extension.AI (minga_sdk v0.1.0)

Copy Markdown View Source

Sanctioned text-generation helper for extensions.

stream/2 streams chunks to reply_to asynchronously; complete/2 blocks until the full text is ready. The user's configured model is used by default.

This is a compile-time stub. At runtime, the real module in Minga's BEAM VM provides the implementation.

Summary

Types

error()

@type error() :: :empty_response | {:provider_error, term()}

event()

@type event() :: {:chunk, String.t()} | {:done, String.t()} | {:error, error()}

message()

@type message() :: %{role: String.t(), content: String.t()}

opts()

@type opts() :: keyword()

Functions

complete(messages, opts \\ [])

@spec complete([message()], opts()) :: {:ok, String.t()} | {:error, error()}

stream(messages, opts \\ [])

@spec stream([message()], opts()) :: {:ok, reference()}