dataflow.core¶

Core Registry System for Haive.

This module provides the central registry system for managing LLM models, embeddings, and other entity types in the system.

Classes¶

ConfigType

Types of configuration that can be associated with entities.

DependencyType

Types of dependencies between entities.

EntityType

Types of entities that can be registered.

ImportStatus

Status of an import operation.

RegistrySystem

Core registry system for managing entities.

Module Contents¶

class dataflow.core.ConfigType¶

Bases: str, enum.Enum

Types of configuration that can be associated with entities.

Initialize self. See help(type(self)) for accurate signature.

class dataflow.core.DependencyType¶

Bases: str, enum.Enum

Types of dependencies between entities.

Initialize self. See help(type(self)) for accurate signature.

class dataflow.core.EntityType¶

Bases: str, enum.Enum

Types of entities that can be registered.

Initialize self. See help(type(self)) for accurate signature.

class dataflow.core.ImportStatus¶

Bases: str, enum.Enum

Status of an import operation.

Initialize self. See help(type(self)) for accurate signature.

class dataflow.core.RegistrySystem¶

Core registry system for managing entities.

The registry system is a centralized repository for tracking and managing entities such as LLM models, embeddings, agents, tools, etc.

It provides both in-memory storage and database persistence via Supabase.

Initialize the registry system.

add_configuration(registry_id, config_type, config_data)¶

Add a configuration to an entity.

Parameters:
  • registry_id (str) – ID of the registered entity

  • config_type (ConfigType) – Type of configuration

  • config_data (Any) – Configuration data

Returns:

ID of the configuration or None on failure

Return type:

str | None

add_dependency(registry_id, dependent_id, dependency_type)¶

Add a dependency between two entities.

Parameters:
  • registry_id (str) – ID of the entity that depends on another

  • dependent_id (str) – ID of the entity being depended on

  • dependency_type (DependencyType) – Type of dependency

Returns:

ID of the dependency or None on failure

Return type:

str | None

add_environment_var(var_name, provider_name, is_required=True, description=None)¶

Add an environment variable to the registry.

Parameters:
  • var_name (str) – Name of the environment variable

  • provider_name (str) – Provider this environment variable is for

  • is_required (bool) – Whether the environment variable is required

  • description (str | None) – Optional description

Returns:

ID of the environment variable entry or None on failure

Return type:

str | None

add_import_log(import_session, entity_name, entity_type, status, message=None, traceback_str=None)¶

Add an import log entry.

Parameters:
  • import_session (str) – Import session identifier

  • entity_name (str) – Name of the entity being imported

  • entity_type (str) – Type of entity

  • status (ImportStatus) – Import status

  • message (str | None) – Optional message

  • traceback_str (str | None) – Optional traceback string

Return type:

None

check_environment_var(var_name)¶

Check if an environment variable is set.

Parameters:

var_name (str) – Name of environment variable to check

Returns:

True if the environment variable is set, False otherwise

Return type:

bool

get_available_providers(entity_type=None)¶

Get all available providers.

Parameters:

entity_type (EntityType | None) – Optional entity type to filter providers by (e.g., LLM_PROVIDER)

Returns:

List of provider data with availability info

Return type:

list[dict[str, Any]]

get_entities_by_type(entity_type)¶

Get all entities of a specific type.

Parameters:

entity_type (EntityType) – Type of entities to retrieve

Returns:

List of entity data

Return type:

list[dict[str, Any]]

get_entity(entity_id)¶

Get an entity by ID.

Parameters:

entity_id (str) – ID of the entity

Returns:

Entity data or None if not found

Return type:

dict[str, Any] | None

get_environment_vars(provider_name=None)¶

Get environment variables, optionally filtered by provider.

Parameters:

provider_name (str | None) – Optional provider to filter by

Returns:

List of environment variable data

Return type:

list[dict[str, Any]]

register_entity(name, entity_type, description=None, metadata=None)¶

Register a new entity in the registry.

Parameters:
  • name (str) – Name of the entity

  • entity_type (EntityType) – Type of entity

  • description (str | None) – Optional description

  • metadata (dict[str, Any] | None) – Optional metadata dictionary

Returns:

ID of the registered entity

Return type:

str

search_entities(query, entity_type=None, metadata_filter=None)¶

Search for entities based on a query.

Parameters:
  • query (str) – Search query

  • entity_type (EntityType | None) – Optional entity type to filter by

  • metadata_filter (dict[str, Any] | None) – Optional metadata filter

Returns:

List of matching entities

Return type:

list[dict[str, Any]]