123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- """
- @author: luojunhui
- """
- import pyapollos
- class apolloConfig(object):
- """
- apolloConfig
- """
- def __init__(self, env="pre"):
- """
- :param env:
- """
- self.apollo_connection = pyapollos.ApolloClient(
- app_id="LongArticlesJob",
- config_server_url="https://preapolloconfig-internal.piaoquantv.com/",
- timeout=10
- )
- match env:
- case "prod":
- self.apollo_connection = pyapollos.ApolloClient(
- app_id="LongArticlesJob",
- config_server_url="https://apolloconfig-internal.piaoquantv.com/",
- timeout=10
- )
- case "dev":
- self.apollo_connection = pyapollos.ApolloClient(
- app_id="LongArticlesJob",
- config_server_url="https://devapolloconfig-internal.piaoquantv.com/",
- timeout=10
- )
- case "pre":
- self.apollo_connection = pyapollos.ApolloClient(
- app_id="LongArticlesJob",
- config_server_url="http://preapolloconfig-internal.piaoquantv.com/",
- timeout=10
- )
- def getConfigValue(self, key):
- """
- 通过 key 获取配置的 Config
- :param key:
- :return:
- """
- response = self.apollo_connection.get_value(key)
- return response
- # aigc后台数据库连接配置
- denet_config = {
- 'host': 'rm-t4na9qj85v7790tf84o.mysql.singapore.rds.aliyuncs.com',
- 'port': 3306,
- 'user': 'crawler_admin',
- 'password': 'cyber#crawler_2023',
- 'db': 'aigc-admin-prod',
- 'charset': 'utf8mb4'
- }
- # 长文数据库连接配置
- long_articles_config = {
- 'host': 'rm-bp14529nwwcw75yr1ko.mysql.rds.aliyuncs.com',
- 'port': 3306,
- 'user': 'changwen_admin',
- 'password': 'changwen@123456',
- 'db': 'long_articles',
- 'charset': 'utf8mb4'
- }
- # 票圈爬虫库数据库配置
- piaoquan_crawler_config = {
- 'host': 'rm-bp1159bu17li9hi94.mysql.rds.aliyuncs.com',
- 'port': 3306,
- 'user': 'crawler',
- 'password': 'crawler123456@',
- 'db': 'piaoquan-crawler',
- 'charset': 'utf8mb4'
- }
- # moonshot model config(kimi)
- moon_shot = {
- "api_key": "sk-5DqYCa88kche6nwIWjLE1p4oMm8nXrR9kQMKbBolNAWERu7q",
- "model": "moonshot-v1-32k",
- "base_url": "https://api.moonshot.cn/v1"
- }
- # deepseek official api
- deep_seek_official_api_key = 'sk-cfd2df92c8864ab999d66a615ee812c5'
- deep_seek_official_model = {
- "DeepSeek-R1": "deepseek-reasoner",
- "DeepSeek-V3": "deepseek-chat",
- }
- # deepseek volcano engine
- deep_seek_model = {
- "DeepSeek-R1": "ep-20250213194143-d8q4t",
- "DeepSeek-V3": "ep-20250213194558-rrmr2"
- }
- deep_seek_default_model = "ep-20250213194558-rrmr2"
- deep_seek_api_key_byte_dance = '5e275c38-44fd-415f-abcf-4b59f6377f72'
- #GeWe
- gewe_token = "d3fb918f-0f36-4769-b095-410181614231"
- gewe_app_id = "wx_GKpVW8xfEhcaxMIK9sSm6"
- gewe_base_url = "http://218.78.116.24:10884"
- # sph decrypt key
- decrypt_key_path = 'applications/so/libsph_decrypt.so'
- # toutiao js path
- toutiao_js_path = 'applications/js/toutiao.js'
|