"""Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT."""

from __future__ import annotations
from mixpeek.types import BaseModel
from typing import Dict, Optional
from typing_extensions import NotRequired, TypedDict


class RerankingOptionsTypedDict(TypedDict):
    weights: NotRequired[Dict[str, float]]
    r"""
    Weights to blend different ranking signals. Must sum to 1.0.
    - feedback: Weight for feedback-based score (positive, negative)
    - popularity: Weight for user interaction signals (clicks, views)

    """
    enable_reranking: NotRequired[bool]
    r"""
    Enable interaction-based score adjustments.
    When enabled, historical interactions will influence ranking:
    - Positive feedback and clicks boost scores
    - Negative feedback reduces scores
    - View duration and skip signals are considered
    - Adjustments are weighted by recency

    """


class RerankingOptions(BaseModel):
    weights: Optional[Dict[str, float]] = None
    r"""
    Weights to blend different ranking signals. Must sum to 1.0.
    - feedback: Weight for feedback-based score (positive, negative)
    - popularity: Weight for user interaction signals (clicks, views)

    """

    enable_reranking: Optional[bool] = False
    r"""
    Enable interaction-based score adjustments.
    When enabled, historical interactions will influence ranking:
    - Positive feedback and clicks boost scores
    - Negative feedback reduces scores
    - View duration and skip signals are considered
    - Adjustments are weighted by recency

    """
