Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Evidentlyai Evidently SDK Configs

From Leeroopedia
Revision as of 10:38, 27 September 2026 by Agent (talk | contribs) (Sync from local file)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains SDK, Configs, Versioning, Backward Compatibility
Last Updated 2026-02-14 12:00 GMT

Overview

Provides a backward-compatible configuration SDK that re-exports artifact classes as config aliases, along with the RemoteGenericConfig entity, the abstract ConfigAPI interface, and the cloud-specific CloudConfigAPI implementation.

Description

The SDK configs module maintains backward compatibility by exposing configuration management through artifact-based implementations. All core config types are aliases to their artifact counterparts.

Type Aliases: The module re-exports many artifact types under config-oriented names:

  • GenericConfig is Artifact
  • ConfigContent is ArtifactContent
  • ConfigContentType is ArtifactContentType
  • ConfigMetadata is ArtifactMetadata
  • ConfigVersion is ArtifactVersion
  • ConfigVersionMetadata is ArtifactVersionMetadata

RemoteGenericConfig: Extends GenericConfig (i.e., Artifact) with API binding capabilities. Once bound to a ConfigAPI instance, it provides convenience methods for version management (list_versions, get_version, bump_version), deletion, and saving metadata changes. The interface mirrors RemoteArtifact but uses config-specific API methods.

DescriptorContent: A concrete ConfigContent subclass for storing Descriptor objects. It serializes descriptors to JSON and registers itself in the global content type mapping.

ConfigAPI: Abstract base class defining the full CRUD interface for configs and their versions. Mirrors ArtifactAPI with config-specific naming: list_configs, get_config, create_config, bump_config_version, etc.

CloudConfigAPI: Concrete implementation of ConfigAPI that communicates with the cloud /api/configs REST endpoint via a CloudWorkspace. It also provides typed helper methods add_descriptor() and get_descriptor() for managing descriptor configs, and generic typed version helpers _add_typed_version() and _get_typed_version().

Usage

Use this module when working with the Evidently Cloud deployment for configuration management. For OSS deployments, configurations are managed through the artifact system with adapters (see sdk.adapters.ConfigArtifactAdapter). The DescriptorContent class enables storing Descriptor objects as versioned configs.

Code Reference

Source Location

Signature

# Type aliases (re-exports from sdk.artifacts)
GenericConfig = Artifact
ConfigContent = ArtifactContent
ConfigMetadata = ArtifactMetadata
ConfigVersion = ArtifactVersion
ConfigVersionMetadata = ArtifactVersionMetadata

class RemoteGenericConfig(GenericConfig):
    def bind(self, api: "ConfigAPI") -> "RemoteGenericConfig": ...
    def list_versions(self) -> List[ConfigVersion]: ...
    def get_version(self, version: VersionOrLatest = "latest") -> ConfigVersion: ...
    def bump_version(self, content: Any): ...
    def delete(self): ...
    def save(self): ...

class DescriptorContent(ConfigContent[Descriptor]):
    __value_class__ = Descriptor
    __value_type__ = ConfigContentType.Descriptor
    @classmethod
    def from_value(cls, value: Descriptor) -> "ConfigContent": ...

class ConfigAPI(ABC):
    def list_configs(self, project_id: STR_UUID) -> List[RemoteGenericConfig]: ...
    def get_or_create_config(self, project_id: STR_UUID, name: str) -> RemoteGenericConfig: ...
    def get_config(self, project_id: STR_UUID, name: str) -> RemoteGenericConfig: ...
    def create_config(self, project_id: STR_UUID, name: str) -> RemoteGenericConfig: ...
    def bump_config_version(self, config_id, content: Any) -> ConfigVersion: ...

class CloudConfigAPI(ConfigAPI):
    def __init__(self, workspace: "CloudWorkspace"): ...
    def add_descriptor(self, project_id: STR_UUID, name: str, descriptor: Descriptor): ...
    def get_descriptor(self, project_id: STR_UUID, name: str, version: VersionOrLatest) -> Descriptor: ...

Import

from evidently.sdk.configs import GenericConfig, ConfigMetadata
from evidently.sdk.configs import ConfigVersion, ConfigVersionMetadata
from evidently.sdk.configs import RemoteGenericConfig
from evidently.sdk.configs import ConfigAPI, CloudConfigAPI
from evidently.sdk.configs import ConfigContent, DescriptorContent

I/O Contract

RemoteGenericConfig

Field Type Description
id ArtifactID (uuid.UUID) Unique config identifier
project_id ProjectID (uuid.UUID) Parent project identifier
name str Human-readable name
metadata ConfigMetadata Timestamps, author, description

CloudConfigAPI Endpoints

Method HTTP Endpoint
list_configs GET /api/configs?project_id={id}
get_config GET /api/configs/by-name/{name}?project_id={id}
get_config_by_id GET /api/configs/{config_id}
create_config POST /api/configs/?project_id={id}
delete_config DELETE /api/configs/{config_id}
update_config PUT /api/configs/{config_id}
list_versions GET /api/configs/{config_id}/versions
get_version GET /api/configs/{config_id}/versions/{version}
create_version POST /api/configs/{config_id}/versions

Usage Examples

from evidently.sdk.configs import CloudConfigAPI

# Initialize with cloud workspace
api = CloudConfigAPI(cloud_workspace)

# Get or create a config
config = api.get_or_create_config(project_id, "my-config")

# Bump version with new content
new_version = config.bump_version(content_data)

# Store a descriptor
from evidently.core.datasets import Descriptor
api.add_descriptor(project_id, "my-descriptor", descriptor_obj)

# Retrieve a descriptor
descriptor = api.get_descriptor(project_id, "my-descriptor", version="latest")

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment