# 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()"

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

from __future__ import annotations

from typing import Any

from goodmem._api_base.llms import LlmsAPIBase, AsyncLlmsAPIBase


# --- Convenience imports ---
from goodmem._transforms import apply_convenience_transforms
from goodmem.models.create_llm_response import CreateLLMResponse
from goodmem.models.endpoint_authentication import EndpointAuthentication
from goodmem.models.llm_capabilities import LLMCapabilities
from goodmem.models.llm_provider_type import LLMProviderType
from goodmem.models.llm_sampling_params import LLMSamplingParams
from goodmem.models.modality import Modality


class LlmsAPI(LlmsAPIBase):
    def create(self, *, display_name: str, model_identifier: str, api_key: str | None = None, api_path: str | None = None, capabilities: LLMCapabilities | None = None, client_config: dict | None = None, credentials: EndpointAuthentication | None = None, default_sampling_params: LLMSamplingParams | None = None, description: str | None = None, endpoint_url: str | None = None, labels: dict | None = None, llm_id: str | None = None, max_context_length: int | None = None, monitoring_endpoint: str | None = None, owner_id: str | None = None, provider_type: LLMProviderType | None = None, supported_modalities: list[Modality] | None = None, version: str | None = None) -> CreateLLMResponse:
        _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 capabilities is not None: _kw["capabilities"] = capabilities
        if client_config is not None: _kw["client_config"] = client_config
        if credentials is not None: _kw["credentials"] = credentials
        if default_sampling_params is not None: _kw["default_sampling_params"] = default_sampling_params
        if description is not None: _kw["description"] = description
        if endpoint_url is not None: _kw["endpoint_url"] = endpoint_url
        if labels is not None: _kw["labels"] = labels
        if llm_id is not None: _kw["llm_id"] = llm_id
        if max_context_length is not None: _kw["max_context_length"] = max_context_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(("llms", "create"), _kw)
        return super().create(**_kw)



class AsyncLlmsAPI(AsyncLlmsAPIBase):
    async def create(self, *, display_name: str, model_identifier: str, api_key: str | None = None, api_path: str | None = None, capabilities: LLMCapabilities | None = None, client_config: dict | None = None, credentials: EndpointAuthentication | None = None, default_sampling_params: LLMSamplingParams | None = None, description: str | None = None, endpoint_url: str | None = None, labels: dict | None = None, llm_id: str | None = None, max_context_length: int | None = None, monitoring_endpoint: str | None = None, owner_id: str | None = None, provider_type: LLMProviderType | None = None, supported_modalities: list[Modality] | None = None, version: str | None = None) -> CreateLLMResponse:
        _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 capabilities is not None: _kw["capabilities"] = capabilities
        if client_config is not None: _kw["client_config"] = client_config
        if credentials is not None: _kw["credentials"] = credentials
        if default_sampling_params is not None: _kw["default_sampling_params"] = default_sampling_params
        if description is not None: _kw["description"] = description
        if endpoint_url is not None: _kw["endpoint_url"] = endpoint_url
        if labels is not None: _kw["labels"] = labels
        if llm_id is not None: _kw["llm_id"] = llm_id
        if max_context_length is not None: _kw["max_context_length"] = max_context_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(("llms", "create"), _kw)
        return await super().create(**_kw)

