# coding: utf-8

"""
    Mixpeek API

    This is the Mixpeek API, providing access to various endpoints for data processing and retrieval.

    The version of the OpenAPI document: 1.3.0
    Contact: info@mixpeek.com
    Generated by OpenAPI Generator (https://openapi-generator.tech)

    Do not edit the class manually.
"""  # noqa: E501


from __future__ import annotations
import json
from enum import Enum
from typing_extensions import Self


class OnEmptyBehavior(str, Enum):
    """
    Behavior when a feature search input is empty or missing.  Controls what happens when the resolved input (text, URL, or base64) is empty, None, or evaluates to an empty string after template resolution.  ┌─────────┬────────────────────────────────────────────────────────────────────┐ │ Value   │ Behavior                                                           │ ├─────────┼────────────────────────────────────────────────────────────────────┤ │ error   │ Fail with validation error (input is required)                     │ │ skip    │ Exclude this search from fusion (let other searches drive results) │ │ random  │ Use random vector to return results (for optional single-search)   │ └─────────┴────────────────────────────────────────────────────────────────────┘  Use Cases:     - error (default): Strict mode - fail fast if required input is missing.       Best for: Production pipelines where missing input indicates a bug.      - skip: Graceful degradation - exclude from fusion if input missing.       Best for: Multi-modal search where user may provide text OR image OR both.       If text is empty but image is provided, only image search runs.      - random: Always return results - use random vector as fallback.       Best for: Single-feature search where you always want results returned,       even if the input is empty (e.g., \"show me anything\" behavior).  Examples:     Multi-modal with optional inputs (skip empty):         ```json         {             \"searches\": [                 {\"feature_uri\": \"text-embed\", \"on_empty\": \"skip\", ...},                 {\"feature_uri\": \"image-embed\", \"on_empty\": \"skip\", ...}             ]         }         ```         - Text only provided → text search runs         - Image only provided → image search runs         - Both provided → fusion of both         - Neither provided → error (no searches to run)      Single search, always return results:         ```json         {             \"searches\": [                 {\"feature_uri\": \"text-embed\", \"on_empty\": \"random\", ...}             ]         }         ```         - Input provided → normal search         - Input empty → random results from collection
    """

    """
    allowed enum values
    """
    ERROR = 'error'
    SKIP = 'skip'
    RANDOM = 'random'

    @classmethod
    def from_json(cls, json_str: str) -> Self:
        """Create an instance of OnEmptyBehavior from a JSON string"""
        return cls(json.loads(json_str))


