mindroot.lib.providers package

Subpackages

Submodules

mindroot.lib.providers.commands module

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

mindroot.lib.providers.hooks module

mindroot.lib.providers.hooks.hook()[source]

mindroot.lib.providers.missing module

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

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[source]

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[source]

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

ensure_preferences_exist() None[source]

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

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

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

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

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

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

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[source]

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

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

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

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

Save preferences in new format.

mindroot.lib.providers.services module

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

Module contents

class mindroot.lib.providers.HookManager[source]

Bases: object

async execute_hooks(name, *args, **kwargs)[source]
get_docstring(name)[source]
get_docstrings()[source]
get_hooks()[source]
register_hook(name, implementation, signature, docstring)[source]
class mindroot.lib.providers.ProviderManager[source]

Bases: object

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