GenAI.Session.State.SettingEntry (GenAI Core v0.1.1)

Dynamic Option/Setting Entry.

background

Background

At runtime, as needed, directives are unpacked into SettingEntries. Constraints and Selectors are merged together to get effective value as of that point in time. Any other options current entry depends on are recursively processed as well.

Link to this section Summary

Link to this section Types

@type t() :: %GenAI.Session.State.SettingEntry{
  constraints: [GenAI.Records.Session.constraint()],
  effective: GenAI.Records.Session.effective_value() | nil,
  impacts: [term()],
  name: term(),
  references: [term()],
  selectors: [GenAI.Records.Session.selector()],
  updated_on: DateTime.t() | nil
}

Link to this section Functions

Link to this function

effective_setting(this, state, context, options, memo \\ %{})

@spec effective_setting(
  t(),
  GenAI.Records.Session.state(),
  GenAI.Records.Session.context(),
  GenAI.Records.Session.options(),
  memo :: map()
) ::
  {{:ok, value :: term()} | {:error, term()},
   {t(), GenAI.Records.Session.state(), memo :: map()}}

Calculate or returned cached effective value for a given setting.

note

Note

If selector depends on input of other settings/artifacts (like chat thread) it will in turn insure dependencies are resolved.

TODO - default value support

Link to this function

expired?(this, context, options)

@spec expired?(t(), term(), term()) :: boolean()
Link to this function

reference_expired?(this, session_state, context, options, memo \\ %{})

@spec reference_expired?(
  t(),
  GenAI.Records.Session.state(),
  GenAI.Records.Session.context(),
  GenAI.Records.Session.options(),
  Map.t()
) :: {boolean(), {t(), GenAI.Records.Session.state(), Map.t()}}