# coding: utf-8

"""
    XingChen 开放接口定义

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

    The version of the OpenAPI document: v2
    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 typing import Optional
from pydantic import BaseModel, Field, StrictBool, StrictStr
from xingchen.models.repository_info import RepositoryInfo

class CharacterAdvancedConfig(BaseModel):
    """
    角色高级配置  # noqa: E501
    """
    repository_info: Optional[RepositoryInfo] = Field(None, alias="repositoryInfo")
    is_real_info: Optional[StrictBool] = Field(None, alias="isRealInfo", description="是否返回真实世界信息")
    search_keyword: Optional[StrictStr] = Field(None, alias="searchKeyword", description="web搜索必填关键字")
    allow_send_image: Optional[StrictBool] = Field(None, alias="allowSendImage", description="是否允许角色发送图片")
    image_style: Optional[StrictStr] = Field(None, alias="imageStyle", description="角色发送图片的风格")
    allow_send_asr: Optional[StrictBool] = Field(None, alias="allowSendAsr", description="是否允许角色发送语音")
    asr_style: Optional[StrictStr] = Field(None, alias="asrStyle", description="角色发送语音风格")
    chat_description: Optional[StrictStr] = Field(None, alias="chatDescription", description="对话介绍")
    __properties = ["repositoryInfo", "isRealInfo", "searchKeyword", "allowSendImage", "imageStyle", "allowSendAsr", "asrStyle", "chatDescription"]

    class Config:
        """Pydantic configuration"""
        allow_population_by_field_name = True
        validate_assignment = True

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

    def to_json(self) -> str:
        """Returns the JSON representation of the model using alias"""
        return json.dumps(self.to_dict())

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

    def to_dict(self):
        """Returns the dictionary representation of the model using alias"""
        _dict = self.dict(by_alias=True,
                          exclude={
                          },
                          exclude_none=True)
        # override the default output from pydantic by calling `to_dict()` of repository_info
        if self.repository_info:
            _dict['repositoryInfo'] = self.repository_info.to_dict()
        return _dict

    @classmethod
    def from_dict(cls, obj: dict) -> CharacterAdvancedConfig:
        """Create an instance of CharacterAdvancedConfig from a dict"""
        if obj is None:
            return None

        if not isinstance(obj, dict):
            return CharacterAdvancedConfig.parse_obj(obj)

        _obj = CharacterAdvancedConfig.parse_obj({
            "repository_info": RepositoryInfo.from_dict(obj.get("repositoryInfo")) if obj.get("repositoryInfo") is not None else None,
            "is_real_info": obj.get("isRealInfo"),
            "search_keyword": obj.get("searchKeyword"),
            "allow_send_image": obj.get("allowSendImage"),
            "image_style": obj.get("imageStyle"),
            "allow_send_asr": obj.get("allowSendAsr"),
            "asr_style": obj.get("asrStyle"),
            "chat_description": obj.get("chatDescription")
        })
        return _obj


