mindroot.lib.providers package - MindRoot 9.10.0 documentation

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# mindroot.lib.providers package

## Subpackages

- mindroot.lib.providers.backup package
  - Module contents

## Submodules

## mindroot.lib.providers.commands module

mindroot.lib.providers.commands.command(*, flags=[])

## mindroot.lib.providers.hooks module

mindroot.lib.providers.hooks.hook()

## mindroot.lib.providers.missing module

async mindroot.lib.providers.missing.get_missing_commands(agent_name=None, context=None)

  Identify commands that are used in agent instructions but not available in the system.

  Parameters:

    agent_name (str, optional) – Name of the agent to check

  Returns:

    Mapping of missing commands and potential plugins that provide them

  Return type:

    dict

## mindroot.lib.providers.model_preferences_v2 module

class mindroot.lib.providers.model_preferences_v2.ModelPreferencesV2

  Bases: `object`

  New model preferences system supporting ordered provider/model pairs for fallback selection.

  add_preference(service: str, provider: str, model: str, position: int | None = None) → None

    Add a provider/model preference for a service at specified position (or end).

  ensure_preferences_exist() → None

    Copy template preferences file to data directory if it doesn’t exist.

  get_ordered_providers_for_service(service_name: str) → List[Tuple[str, str]]

    Get ordered list of (provider, model) pairs for a service.

  get_preferences() → Dict[str, List[List[str]]]

    Get preferences in new format: {service: [[provider, model], …]}

  migrate_from_old_format(old_preferences: List[Dict]) → Dict[str, List[List[str]]]

    Convert old format preferences to new format.

    Old format: [{“service_or_command_name”: “stream_chat”, “flag”: “default”, “model”: “claude-3”}] New format: {“stream_chat”: [[“ah_anthropic”, “claude-3.5-sonnet”]]}

  remove_preference(service: str, provider: str, model: str) → bool

    Remove a provider/model preference for a service. Returns True if removed.

  reorder_preferences(service: str, ordered_pairs: List[List[str]]) → None

    Set the complete ordered list of provider/model pairs for a service.

  save_preferences(preferences: Dict[str, List[List[str]]]) → None

    Save preferences in new format.

## mindroot.lib.providers.services module

mindroot.lib.providers.services.service(*, flags=[])

## Module contents

class mindroot.lib.providers.HookManager

  Bases: `object`

  async execute_hooks(name, *args, **kwargs)
  get_docstring(name)
  get_docstrings()
  get_hooks()
  register_hook(name, implementation, signature, docstring)

class mindroot.lib.providers.ProviderManager

  Bases: `object`

  async exec_with_provider(name, provider, *args, **kwargs)
  async execute(name, *args, **kwargs)
  get_detailed_functions()
  get_docstring(name)
  get_docstrings()
  get_functions()
  get_some_docstrings(names)
  register_function(name, provider, implementation, signature, docstring, flags)