CouncilEx.Profile (CouncilEx v0.1.0)

Copy Markdown View Source

Reusable bundle of runtime/execution options for council members.

A Profile captures the capability stack — provider, model, sampling, tools, retry — separately from the Member, which captures identity (role, system prompt, output schema). The same Member can run on any Profile; the same Profile can dress any Member.

Defining a profile

defmodule MyApp.Profiles.WebHeavy do
  use CouncilEx.Profile

  provider :openai
  model "gpt-4o"
  temperature 0.3
  max_tokens 4000
  tools [MyApp.Tools.WebFetch, MyApp.Tools.WebSearch]
end

Using in a council

defmodule MyApp.PaperCouncil do
  use CouncilEx

  default_profile MyApp.Profiles.WebHeavy

  member :alice, MyApp.Members.Researcher
  member :bob,   MyApp.Members.Researcher, profile: MyApp.Profiles.LocalCheap
  member :judge, MyApp.Members.Critic, temperature: 0.0
end

Resolution order

Final member opts =

profile.opts()
|> Keyword.merge(council member-line opts)

Profile resolution per member:

  1. :profile key on the member line, if present
  2. default_profile/1 on the council, if declared
  3. :default_profile in config :council_ex, ..., if set
  4. nil — member must supply :provider and :model itself

Inline ad-hoc opts on the member line always win over the resolved profile.

Summary

Functions

Resolve final opts for a member, merging the chosen profile (if any) with the inline opts declared on the council member line.

Functions

resolve(member_opts, council_default)

@spec resolve(
  keyword(),
  module() | nil
) :: keyword()

Resolve final opts for a member, merging the chosen profile (if any) with the inline opts declared on the council member line.

Resolution order: inline :profile > council default > app config default. Inline opts always override profile values.