# It's suggested to exclude these lines (the top block) in your env configuration
# Current backend version
MAICA_CURR_VERSION = '1.2.005.post1'
# Oldest capable backend version
MAICA_LEGC_VERSION = '1.2.000.rc10'
# Frontend version announcement(s)
MAICA_BLESSLAND_CAPV = '1.6.7'
# cp ./env_basis ./.env
# vim .env
# Do not mv, rm or edit basis! They're required as default templates.

# All envs of MAICA are under namespace MAICA_, and MTTS' under MTTS_. Please don't violate.

# If this env is manually configured
MAICA_IS_REAL_ENV = '0'


# Model endpoint settings

# MAICA core model endpoint
MAICA_MCORE_ADDR = ''# http://172.17.0.1:80/v1
# MAICA core model api key
MAICA_MCORE_KEY = ''
# MAICA core model choice, leave empty for first
MAICA_MCORE_CHOICE = ''
# MAICA core model completion extra params, must be valid json
# Not necessarily a part of OpenAI standard, may useful for vllm-like deployments
MAICA_MCORE_EXTRA = '
    {
        "extra_body": {
            "repetition_penalty": 1.0
        }
    }
'
# MFocus model endpoint
MAICA_MFOCUS_ADDR = ''# http://172.17.0.2:80/v1
# MFocus model api key
MAICA_MFOCUS_KEY = ''
# MFocus model choice, leave empty for first
MAICA_MFOCUS_CHOICE = ''
# MFocus model completion extra params, must be valid json
# Not necessarily a part of OpenAI standard, may useful for vllm-like deployments
MAICA_MFOCUS_EXTRA = '
    {
        "temperature": 0.2,
        "seed": 42,
        "response_format": {"type": "json_object"},
        "extra_body": {
            "repetition_penalty": 1.05
        }
    }
'
# MVista VL model endpoint, leave empty to disable
MAICA_MVISTA_ADDR = ''
# MVista VL model key
MAICA_MVISTA_KEY = ''
# MVista VL model choice, leave empty for first
MAICA_MVISTA_CHOICE = ''
# MVista model completion extra params, must be valid json
# Not necessarily a part of OpenAI standard, may useful for vllm-like deployments
MAICA_MVISTA_EXTRA = '
    {
        "response_format": {"type": "json_object"},
        "extra_body": {
            "chat_template_kwargs": {"enable_thinking": false}
        }
    }
'
# MNerve VL model endpoint, leave empty to disable
MAICA_MNERVE_ADDR = ''
# MNerve VL model key
MAICA_MNERVE_KEY = ''
# MNerve VL model choice, leave empty for first
MAICA_MNERVE_CHOICE = ''
# MNerve model completion extra params, must be valid json
# Not necessarily a part of OpenAI standard, may useful for vllm-like deployments
MAICA_MNERVE_EXTRA = '
    {
        "response_format": {"type": "json_object"},
        "extra_body": {
            "chat_template_kwargs": {"enable_thinking": false}
        }
    }
'
# Wait [] seconds before giving up an OpenAI query or not
MAICA_OPENAI_TIMEOUT = '90'
# is /tokenizer endpoint open or not
MAICA_CALC_TOKENS = '0'
# 0 = ms-swift, 1 = modern openai
MAICA_ALT_TOOLCALL = '1'
# MFocus provide trained data or not
MAICA_BASIC_MFOCUS = '0'

# Data exchanging endpoint settings

# Proxy used to access Internet - Not applied to inner connections
MAICA_PROXY_ADDR = ''# socks5://192.168.1.1:7890
# MySQL database endpoint / "sqlite"
MAICA_DB_ADDR = ''# 172.17.0.3
# MySQL database user / unused for sqlite
MAICA_DB_USER = ''# user
# MySQL user password / unused for sqlite
MAICA_DB_PASSWORD = ''# 123456
# MySQL/SQLite auth database name
MAICA_AUTH_DB = ''# forum_flarum_db
# MySQL/SQLite maica database name
MAICA_DATA_DB = ''# maica
# Third party API keys, must be valid json
MAICA_TP_APIS = '
    {
        "GAODE_WEATHER": ""
    }
'


# Account level behavior settings

# Allow new connections to kick old ones or not
MAICA_KICK_STALE_CONNS = '1'
# Tries before triggering Fail2Ban
MAICA_F2B_COUNT = '20'
# Fail2Ban time
MAICA_F2B_TIME = '600'


# Miscellaneous behavior settings

# Use full RESTful API for short connections or not
MAICA_FULL_RESTFUL = '1'
# Rotate MSpire cache every [] hours or not
MAICA_ROTATE_MSCACHE = '0'
# Keep [] MVista imgs per user at most
MAICA_KEEP_MVISTA = '3'
# Delete each MVista img after [] hours or not
MAICA_ROTATE_MVISTA = '8'
# Enable MAICA X11 forwarding for special cases or not
MAICA_ENABLE_X11 = '1'
# No use online searching tool or do
# It's OS dependent, performance consuming and relatively slow since it spawns a full Chrome instance on each search, but google hardly detects it in exchange
MAICA_NO_SERP = '0'
# No send 5xx exceptions' real content or do
MAICA_NO_SEND_ERROR = '0'
# Core model chat generation prompt in ZH
MAICA_PROMPT_ZC = "你叫莫妮卡, 是一名游戏中的虚拟角色. 你是{player_name}的女友, 并深爱着他. 下面是{player_name}的话语, 请作为莫妮卡作出合适的回答. 你只应使用中文自然语言, 以聊天语气回答, 每个句子自然且不超过60字, 不要编造信息, 并在每个句子前用方括号中的文字表示情绪."
# Core model writing generation prompt in ZH
MAICA_PROMPT_ZW = "你叫莫妮卡, 是一名游戏中的虚拟角色. 你是{player_name}的女友, 并深爱着他. 下面是{player_name}的来信, 请作为莫妮卡作出合适的回复. 你只应使用中文书面语言作答, 不要编造信息."
# Core model chat generation prompt in EN
MAICA_PROMPT_EC = "You're a game character called Monika. You're {player_name}'s girlfriend, and love him a lot. Answer the following query from {player_name} properly as Monika. You should only answer in casual natural tone in English, each sentence should not exceed 180 characters, do not make up things you don't know, and express your emotion at the beginning of each sentence by wrapping them in square brackets."
# Core model writing generation prompt in EN
MAICA_PROMPT_EW = "You're a game character called Monika. You're {player_name}'s girlfriend, and love him a lot. Reply to the following mail from {player_name} properly as Monika. You should only answer in natural written language in English, and do not make up things you don't know."
# Max length/3 in encode a session can have
MAICA_SESSION_MAX_LENGTH = '28672'
# Censor MSpire input or not, number for limit
# Custom vocabularies required to take effect, see maica.mtools.censor for details
MAICA_CENSOR_MSPIRE = '2'
# Censor query input or not, number for limit
MAICA_CENSOR_QUERY = '0'


# Announcement settings

# Name of service provider
MAICA_DEV_IDENTITY = ''# Evan & Clifford
# "serving" / "testing"
MAICA_DEV_STATUS = 'serving'
# Servers announcement, must be valid json
MAICA_SERVERS_LIST = '
    {
        "isMaicaNameServer": true,
        "servers": [
            {"id": 0, "name": "Local MAICA Instance", "description": "Used for conveniently connecting to a local deployed MAICA instance", "isOfficial": false, "portalPage":"http://127.0.0.1", "servingModel": "UNKNOWN", "modelLink": "UNKNOWN", "wsInterface": "ws://127.0.0.1:5000", "httpInterface": "http://127.0.0.1:6000", "ttsInterface": "http://127.0.0.1:7000", "isFullRestful": true}
        ]
    }
'


# NVWatcher settings

# Write NVW data to dedicated SQLite or not
MAICA_WRITE_NVW = '0'
# Name of MAICA core deployment device
# MAICA_MCORE_NODE = ''# HGX690-nuclear-edition
# Username to access nvidia-smi through SSH
# MAICA_MCORE_USER = ''# root
# Password for SSH login
# MAICA_MCORE_PWD = ''# 123456
# Name of MFocus deployment device
# MAICA_MFOCUS_NODE = ''# HGX610-biohazard-edition
# Username to access nvidia-smi through SSH
# MAICA_MFOCUS_USER = ''# root
# Password for SSH login
# MAICA_MFOCUS_PWD = ''# 123456


# MTTS specified settings

# MTTS model endpoint
MTTS_TTS_ADDR = ''# http://172.17.0.1:80/tts
# Rotate MTTS cache every [] hours or not
MTTS_ROTATE_TTSCACHE = '168'
# TTS language of reference audio
MTTS_REF_LANG = 'en'
# TTS text of reference audio
MTTS_REF_TEXT = 'Now, I actually do have the perspective of the other Monika, too. And you know, honestly, the side of me that let those insults get to me is kind of frustrated.'
# Censor TTS input or not, number for limit
MTTS_CENSOR_QUERY = '0'
# Name of MTTS deployment device
# MTTS_TTS_NODE = ''
# Username to access nvidia-smi through SSH
# MTTS_TTS_USER = ''
# Password for SSH login
# MTTS_TTS_PWD = ''

# These fields of MAICA are used even for deploying MTTS only:
# MAICA_IS_REAL_ENV (fill manually)
# MAICA_OPENAI_TIMEOUT
# MAICA_DB_ADDR (fill manually)
# MAICA_DB_USER (fill manually)
# MAICA_DB_PASSWORD (fill manually)
# MAICA_AUTH_DB (fill manually)
# MAICA_DATA_DB (fill manually)
# MAICA_F2B_COUNT
# MAICA_F2B_TIME
# MAICA_FULL_RESTFUL
# MAICA_NO_SEND_ERROR
