# DO NOT EDIT — generated by _client_gen/convenience_emitter.py from convenience.json.
# Regenerate with: cd clients/v2 && python -c "from _client_gen.convenience_emitter import generate_convenience; generate_convenience()"

"""Embedders API namespace — generated from convenience.json."""

from __future__ import annotations

from typing import Any

from goodmem._api_base.embedders import EmbeddersAPIBase, AsyncEmbeddersAPIBase


# --- Convenience imports ---
from goodmem._transforms import apply_convenience_transforms
from goodmem.models.distribution_type import DistributionType
from goodmem.models.embedder_response import EmbedderResponse
from goodmem.models.endpoint_authentication import EndpointAuthentication
from goodmem.models.modality import Modality
from goodmem.models.provider_type import ProviderType


class EmbeddersAPI(EmbeddersAPIBase):
    def create(self, *, display_name: str, model_identifier: str, api_key: str | None = None, api_path: str | None = None, credentials: EndpointAuthentication | None = None, description: str | None = None, dimensionality: int | None = None, distribution_type: DistributionType | None = "DENSE", embedder_id: str | None = None, endpoint_url: str | None = None, labels: dict | None = None, max_sequence_length: int | None = None, monitoring_endpoint: str | None = None, owner_id: str | None = None, provider_type: ProviderType | None = None, supported_modalities: list[Modality] | None = None, version: str | None = None) -> EmbedderResponse:
        _kw: dict[str, Any] = {"display_name": display_name, "model_identifier": model_identifier}
        if api_key is not None: _kw["api_key"] = api_key
        if api_path is not None: _kw["api_path"] = api_path
        if credentials is not None: _kw["credentials"] = credentials
        if description is not None: _kw["description"] = description
        if dimensionality is not None: _kw["dimensionality"] = dimensionality
        if distribution_type is not None: _kw["distribution_type"] = distribution_type
        if embedder_id is not None: _kw["embedder_id"] = embedder_id
        if endpoint_url is not None: _kw["endpoint_url"] = endpoint_url
        if labels is not None: _kw["labels"] = labels
        if max_sequence_length is not None: _kw["max_sequence_length"] = max_sequence_length
        if monitoring_endpoint is not None: _kw["monitoring_endpoint"] = monitoring_endpoint
        if owner_id is not None: _kw["owner_id"] = owner_id
        if provider_type is not None: _kw["provider_type"] = provider_type
        if supported_modalities is not None: _kw["supported_modalities"] = supported_modalities
        if version is not None: _kw["version"] = version
        apply_convenience_transforms(("embedders", "create"), _kw)
        return super().create(**_kw)



class AsyncEmbeddersAPI(AsyncEmbeddersAPIBase):
    async def create(self, *, display_name: str, model_identifier: str, api_key: str | None = None, api_path: str | None = None, credentials: EndpointAuthentication | None = None, description: str | None = None, dimensionality: int | None = None, distribution_type: DistributionType | None = "DENSE", embedder_id: str | None = None, endpoint_url: str | None = None, labels: dict | None = None, max_sequence_length: int | None = None, monitoring_endpoint: str | None = None, owner_id: str | None = None, provider_type: ProviderType | None = None, supported_modalities: list[Modality] | None = None, version: str | None = None) -> EmbedderResponse:
        _kw: dict[str, Any] = {"display_name": display_name, "model_identifier": model_identifier}
        if api_key is not None: _kw["api_key"] = api_key
        if api_path is not None: _kw["api_path"] = api_path
        if credentials is not None: _kw["credentials"] = credentials
        if description is not None: _kw["description"] = description
        if dimensionality is not None: _kw["dimensionality"] = dimensionality
        if distribution_type is not None: _kw["distribution_type"] = distribution_type
        if embedder_id is not None: _kw["embedder_id"] = embedder_id
        if endpoint_url is not None: _kw["endpoint_url"] = endpoint_url
        if labels is not None: _kw["labels"] = labels
        if max_sequence_length is not None: _kw["max_sequence_length"] = max_sequence_length
        if monitoring_endpoint is not None: _kw["monitoring_endpoint"] = monitoring_endpoint
        if owner_id is not None: _kw["owner_id"] = owner_id
        if provider_type is not None: _kw["provider_type"] = provider_type
        if supported_modalities is not None: _kw["supported_modalities"] = supported_modalities
        if version is not None: _kw["version"] = version
        apply_convenience_transforms(("embedders", "create"), _kw)
        return await super().create(**_kw)

