# 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: 0.82
    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 pprint
import re  # noqa: F401
import json

from pydantic import BaseModel, ConfigDict, Field
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class ExplainRetrieverRequest(BaseModel):
    """
    Request to get execution plan for a retriever.  Provides optional hypothetical inputs to tailor the execution plan estimation. The explain endpoint analyzes your retriever configuration and returns cost/latency estimates without actually executing the query.  Use Cases:     - See how plan changes with different input values     - Estimate costs for different query patterns     - Understand impact of parameter changes (e.g., top_k)     - Test stage behavior with representative inputs  Behavior:     - If inputs are provided, they're used for tailored estimation     - If inputs are not provided, default/representative values are used     - Inputs do NOT need to match your input_schema exactly     - No actual retrieval is performed (explain is analysis only)
    """ # noqa: E501
    inputs: Optional[Dict[str, Any]] = Field(default=None, description="Hypothetical inputs for tailored execution plan estimation. These values are used to analyze stage behavior and estimate costs.   NOT REQUIRED - if omitted, default/representative values are used.   Common inputs: - 'query': Search query text (for semantic search stages) - 'top_k': Number of results to return (affects search scope) - Filter parameters: Category, price range, etc.   Examples: - {'query': 'laptop'} - Simple text query - {'query': 'laptop', 'top_k': 100} - Query with custom limit - {'query': 'laptop', 'category': 'electronics', 'price_max': 1000} - Query with filters   Note: Inputs are for estimation only. No actual search is performed.")
    __properties: ClassVar[List[str]] = ["inputs"]

    model_config = ConfigDict(
        populate_by_name=True,
        validate_assignment=True,
        protected_namespaces=(),
    )


    def to_str(self) -> str:
        """Returns the string representation of the model using alias"""
        return pprint.pformat(self.model_dump(by_alias=True))

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
        return json.dumps(self.to_dict())

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

    def to_dict(self) -> Dict[str, Any]:
        """Return the dictionary representation of the model using alias.

        This has the following differences from calling pydantic's
        `self.model_dump(by_alias=True)`:

        * `None` is only added to the output dict for nullable fields that
          were set at model initialization. Other fields with value `None`
          are ignored.
        """
        excluded_fields: Set[str] = set([
        ])

        _dict = self.model_dump(
            by_alias=True,
            exclude=excluded_fields,
            exclude_none=True,
        )
        return _dict

    @classmethod
    def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
        """Create an instance of ExplainRetrieverRequest from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return cls.model_validate(obj)

        _obj = cls.model_validate({
            "inputs": obj.get("inputs")
        })
        return _obj


