Rho.Config (rho v0.1.0)

Copy Markdown View Source

The host's settings for rho, config :rho, ..., each with a default that works on a computer. :data_dir, :default_model and :system_prompt may be given as {module, function, args} (or a 0-arity function), called each time the value is read, so a host can keep them in its own settings and change them at run time.

  • :data_dir: where rho keeps sessions, artifacts, todo lists, the cost ledger, usage.json, settings.json, the trimmed model catalog and (with the default credential store) the sign-ins. Default: MOB_DATA_DIR when set (a mob app's private files dir), else the OS's per-user data dir for "rho" (:filename.basedir/2). Created on first read.
  • :credential_store: a Rho.CredentialStore module. Default Rho.CredentialStore.File (0600 files under the data dir); a phone app plugs in the platform's secure store (Keystore / Keychain).
  • :settings: a Rho.Settings module (fallback model, daily cost cap). Default Rho.Settings.File (settings.json in the data dir).
  • :default_model: a req_llm spec, default "anthropic:claude-haiku-4-5".
  • :system_prompt: the loop's system prompt when a loop isn't given one. Default Rho.default_system_prompt/0.
  • :namespace: the prefix of the customType of the loop's notices in a session ("<namespace>.notice", .error, .aside). Default "rho"; Operator's sessions use "operator".
  • :open_url: how Rho.Auth.Login opens the provider's sign-in page, fn url -> :ok end or an MFA taking the URL last. Default Rho.Auth.Login.open_in_browser/1 (open / xdg-open / start); a mob app sets {Mob.Device, :open_url, []}.
  • :app_name: what the sign-in pages call the app ("Switch back to … to finish signing in"). Default "the app".
  • :hints: where the user fixes a failed call, as Rho.LLM.describe/1 and Rho.Auth.Login say it: sign_in: (default "from the app's settings", as in "sign in again from …") and switch_model: (default "in the app's settings"); and, for Dyn (Rho.Dyn.agent_guide/0, dyn_propose), approve:, how the human approves a proposed generation (default "on the phone with the screen lock (fingerprint, face, PIN, pattern, password or passcode)", as Rho.Dyn.Approval.Biometric behind an approve control).
  • :tools, :tool_sources: Rho.ToolRegistry's core tools and registry sources, when Rho.Supervisor isn't given them.
  • :dyn: the Dyn layer (agent-written code, Rho.Dyn), off by default; its keys are Rho.Dyn.Config's.

Summary

Functions

The :app_name the sign-in pages show.

The :credential_store module in effect.

The data dir (created if missing).

The :default_model spec, resolved: what Rho.start_loop/1 uses without a :model.

The :hints entry key (:sign_in, :switch_model or :approve).

The :namespace prefix of the loop's notice customTypes.

Opens url for the user with the configured :open_url.

A config value: a function or {m, f, a} is called (with extra args appended), anything else is returned as it is.

The :settings module in effect.

The :system_prompt, resolved (Rho.default_system_prompt/0 when unset).

Functions

app_name()

@spec app_name() :: String.t()

The :app_name the sign-in pages show.

credential_store()

@spec credential_store() :: module()

The :credential_store module in effect.

data_dir()

@spec data_dir() :: String.t()

The data dir (created if missing).

default_model()

@spec default_model() :: String.t()

The :default_model spec, resolved: what Rho.start_loop/1 uses without a :model.

hint(key)

@spec hint(:sign_in | :switch_model | :approve) :: String.t()

The :hints entry key (:sign_in, :switch_model or :approve).

namespace()

@spec namespace() :: String.t()

The :namespace prefix of the loop's notice customTypes.

open_url(url)

@spec open_url(String.t()) :: term()

Opens url for the user with the configured :open_url.

resolve(fun, extra)

@spec resolve(term(), [term()]) :: term()

A config value: a function or {m, f, a} is called (with extra args appended), anything else is returned as it is.

settings()

@spec settings() :: module()

The :settings module in effect.

system_prompt()

@spec system_prompt() :: String.t()

The :system_prompt, resolved (Rho.default_system_prompt/0 when unset).