AshBaml.Resource (ash_baml v0.2.0)

View Source

The AshBaml resource extension.

Adds the baml do ... end DSL block to Ash resources.

The call_baml/1 helper macro is automatically available when using this extension:

defmodule MyApp.ChatResource do
  use Ash.Resource,
    domain: MyApp.Domain,
    extensions: [AshBaml.Resource]

  baml do
    client_module MyApp.BamlClient
  end

  actions do
    action :chat, MyApp.BamlClient.Types.Reply do
      argument :message, :string
      run call_baml(:ChatAgent)
    end
  end
end

Summary

Functions

baml(body)

(macro)