# coding: utf-8

"""
    

    No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

    The version of the OpenAPI document: 
    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, StrictBool
from typing import Any, ClassVar, Dict, List, Optional
from typing import Optional, Set
from typing_extensions import Self

class LLMCapabilities(BaseModel):
    """
    Capabilities and features supported by an LLM service
    """ # noqa: E501
    supports_chat: Optional[StrictBool] = Field(default=None, description="Supports conversational/chat completion format with message roles", alias="supportsChat")
    supports_completion: Optional[StrictBool] = Field(default=None, description="Supports raw text completion with prompt continuation", alias="supportsCompletion")
    supports_function_calling: Optional[StrictBool] = Field(default=None, description="Supports function/tool calling with structured responses", alias="supportsFunctionCalling")
    supports_system_messages: Optional[StrictBool] = Field(default=None, description="Supports system prompts to define model behavior and context", alias="supportsSystemMessages")
    supports_streaming: Optional[StrictBool] = Field(default=None, description="Supports real-time token streaming during generation", alias="supportsStreaming")
    supports_sampling_parameters: Optional[StrictBool] = Field(default=None, description="Supports sampling parameters like temperature, top_p, and top_k for generation control", alias="supportsSamplingParameters")
    __properties: ClassVar[List[str]] = ["supportsChat", "supportsCompletion", "supportsFunctionCalling", "supportsSystemMessages", "supportsStreaming", "supportsSamplingParameters"]

    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 LLMCapabilities 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,
        )
        # set to None if supports_chat (nullable) is None
        # and model_fields_set contains the field
        if self.supports_chat is None and "supports_chat" in self.model_fields_set:
            _dict['supportsChat'] = None

        # set to None if supports_completion (nullable) is None
        # and model_fields_set contains the field
        if self.supports_completion is None and "supports_completion" in self.model_fields_set:
            _dict['supportsCompletion'] = None

        # set to None if supports_function_calling (nullable) is None
        # and model_fields_set contains the field
        if self.supports_function_calling is None and "supports_function_calling" in self.model_fields_set:
            _dict['supportsFunctionCalling'] = None

        # set to None if supports_system_messages (nullable) is None
        # and model_fields_set contains the field
        if self.supports_system_messages is None and "supports_system_messages" in self.model_fields_set:
            _dict['supportsSystemMessages'] = None

        # set to None if supports_streaming (nullable) is None
        # and model_fields_set contains the field
        if self.supports_streaming is None and "supports_streaming" in self.model_fields_set:
            _dict['supportsStreaming'] = None

        # set to None if supports_sampling_parameters (nullable) is None
        # and model_fields_set contains the field
        if self.supports_sampling_parameters is None and "supports_sampling_parameters" in self.model_fields_set:
            _dict['supportsSamplingParameters'] = None

        return _dict

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

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

        _obj = cls.model_validate({
            "supportsChat": obj.get("supportsChat"),
            "supportsCompletion": obj.get("supportsCompletion"),
            "supportsFunctionCalling": obj.get("supportsFunctionCalling"),
            "supportsSystemMessages": obj.get("supportsSystemMessages"),
            "supportsStreaming": obj.get("supportsStreaming"),
            "supportsSamplingParameters": obj.get("supportsSamplingParameters")
        })
        return _obj


