xiaogpt 3.5__py3-none-any.whl → 3.10__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
xiaogpt/bot/gemini_bot.py CHANGED
@@ -32,13 +32,15 @@ safety_settings = [
32
32
  class GeminiBot(ChatHistoryMixin, BaseBot):
33
33
  name = "Gemini"
34
34
 
35
- def __init__(self, gemini_key: str, gemini_api_domain: str) -> None:
35
+ def __init__(
36
+ self, gemini_key: str, gemini_api_domain: str, gemini_model: str
37
+ ) -> None:
36
38
  import google.generativeai as genai
37
39
 
38
40
  from google.auth import api_key
39
41
 
40
42
  credentials = api_key.Credentials(gemini_key)
41
- if len(gemini_api_domain) > 0:
43
+ if gemini_api_domain:
42
44
  print("Use custom gemini_api_domain: " + gemini_api_domain)
43
45
  credentials._universe_domain = gemini_api_domain
44
46
  genai.configure(
@@ -54,7 +56,7 @@ class GeminiBot(ChatHistoryMixin, BaseBot):
54
56
 
55
57
  self.history = []
56
58
  model = genai.GenerativeModel(
57
- model_name="gemini-pro",
59
+ model_name=gemini_model or "gemini-2.0-flash-lite",
58
60
  generation_config=generation_config,
59
61
  safety_settings=safety_settings,
60
62
  )
@@ -63,7 +65,9 @@ class GeminiBot(ChatHistoryMixin, BaseBot):
63
65
  @classmethod
64
66
  def from_config(cls, config):
65
67
  return cls(
66
- gemini_key=config.gemini_key, gemini_api_domain=config.gemini_api_domain
68
+ gemini_key=config.gemini_key,
69
+ gemini_api_domain=config.gemini_api_domain,
70
+ gemini_model=config.gemini_model,
67
71
  )
68
72
 
69
73
  async def ask(self, query, **options):
xiaogpt/config.py CHANGED
@@ -59,6 +59,7 @@ class Config:
59
59
  llama_api_key: str = os.getenv("GROQ_API_KEY", "") # use groq
60
60
  glm_key: str = os.getenv("CHATGLM_KEY", "")
61
61
  gemini_key: str = os.getenv("GEMINI_KEY", "") # keep the old rule
62
+ gemini_model: str = os.getenv("GEMINI_MODEL", "") # keep the old rule
62
63
  qwen_key: str = os.getenv("DASHSCOPE_API_KEY", "") # keep the old rule
63
64
  serpapi_api_key: str = os.getenv("SERPAPI_API_KEY", "")
64
65
  gemini_api_domain: str = os.getenv(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: xiaogpt
3
- Version: 3.5
3
+ Version: 3.10
4
4
  Summary: Play ChatGPT or other LLM with xiaomi AI speaker
5
5
  Author-Email: yihong0618 <zouzou0208@gmail.com>
6
6
  License: MIT
@@ -1,14 +1,14 @@
1
- xiaogpt-3.5.dist-info/METADATA,sha256=fqymHqLmsFnNBE2G332D8ZbdmEFJ0gI3q08OXn6M3j0,31516
2
- xiaogpt-3.5.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
- xiaogpt-3.5.dist-info/entry_points.txt,sha256=q4WRS7kS4kQ5kZX57Fq40VrhCi74NZcyRPRX4JP2veo,61
4
- xiaogpt-3.5.dist-info/licenses/LICENSE,sha256=XdClh516MvlnOf9749JZHCxSB7y6_fyXcWmLDz6IkZY,1063
1
+ xiaogpt-3.10.dist-info/METADATA,sha256=7RFe3n9WrY2Zc9V3d_lnBWlJCZLfQBD7PtuLtm-WSNU,31517
2
+ xiaogpt-3.10.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
3
+ xiaogpt-3.10.dist-info/entry_points.txt,sha256=q4WRS7kS4kQ5kZX57Fq40VrhCi74NZcyRPRX4JP2veo,61
4
+ xiaogpt-3.10.dist-info/licenses/LICENSE,sha256=XdClh516MvlnOf9749JZHCxSB7y6_fyXcWmLDz6IkZY,1063
5
5
  xiaogpt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  xiaogpt/__main__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
7
7
  xiaogpt/bot/__init__.py,sha256=BDGvj1JuWVw47qfREWGKnSXeiFg6DVJJAz2rHVryqmc,1160
8
8
  xiaogpt/bot/base_bot.py,sha256=oKn6LLFHXol4hKrSrjnxknrOqrcGICtT_GPPYRNxpkw,1467
9
9
  xiaogpt/bot/chatgptapi_bot.py,sha256=TpAL_Rarz535PcbJhYQUNYurZ_zoXGMAvBl0H8fiqI8,3654
10
10
  xiaogpt/bot/doubao_bot.py,sha256=UufQmYcPbwTLTYDZUQwRy4Hg24vgPEa3hdeZWMWw9YM,2773
11
- xiaogpt/bot/gemini_bot.py,sha256=vX-fTWyPwdB4N0HDQ9uIRCB4KvV-YgBqXjkrqgg4WHs,2516
11
+ xiaogpt/bot/gemini_bot.py,sha256=UrLMhPi79PJ2fFiIDmizdBPmOZ3-glpcqcSsU7TVcKg,2626
12
12
  xiaogpt/bot/glm_bot.py,sha256=A90QbbU2UU7pr0o4_5-fxF4Gkz7gFB0LADIGx7N5aO4,1713
13
13
  xiaogpt/bot/langchain_bot.py,sha256=4Uz5iOYzA2ongCklS-9zBse2fw-7kEE_9wITH7wdVCc,1944
14
14
  xiaogpt/bot/llama_bot.py,sha256=HRR_ycuC6DY5MQTKauXEayQ0o_JKk9t-ea3mblscm8E,708
@@ -16,7 +16,7 @@ xiaogpt/bot/moonshot_bot.py,sha256=PrVRBskZx-U0lH_3RVe89QJa7WKHYqhpft0089pYQz0,8
16
16
  xiaogpt/bot/qwen_bot.py,sha256=rFCOz5uiUsuhePjPozdCecNv5HGiUTNEhHYNw3Exexs,3590
17
17
  xiaogpt/bot/yi_bot.py,sha256=D7JEIh8KPVMvlOLaEVr9ahvyMaJLGToHP_gWU3RoYPc,784
18
18
  xiaogpt/cli.py,sha256=iUPQwiZqIpzu1HoinneijBEfVKV7F_f_YMgqPPZM5lA,5932
19
- xiaogpt/config.py,sha256=GpK3RXJI_B5YBKMxErAh9wUH1FWqVbQppZM4f7B-EoI,7043
19
+ xiaogpt/config.py,sha256=0ygn73UkWhLSIayb-8sS3qV2tajhWRlE3AaM-cFO898,7118
20
20
  xiaogpt/langchain/callbacks.py,sha256=yR9AXQt9OHVYBWC47Q1I_BUT4Xg9iM44vnW2vv0BLpE,2616
21
21
  xiaogpt/langchain/chain.py,sha256=z0cqRlL0ElWnf31ByxZBN7AKOT-svXQDt5_NDft_nYc,1495
22
22
  xiaogpt/langchain/examples/email/mail_box.py,sha256=xauqrjE4-G4XPQnokUPE-MZgAaHQ_VrUDLlbfYTdCoo,6372
@@ -28,4 +28,4 @@ xiaogpt/tts/live.py,sha256=7-NpuOU7E6GNht1PHjAA8_miXdFVDk8C7aL-sY1xqPE,3299
28
28
  xiaogpt/tts/mi.py,sha256=1MzCB27DBohPQ_4Xz4W_FV9p-chJFDavOHB89NviLcM,1095
29
29
  xiaogpt/utils.py,sha256=YYmRDNtccxqB9gyN_xhKZwgL1_PNYEp7So_-jt2tiVg,2668
30
30
  xiaogpt/xiaogpt.py,sha256=zHZFijx-tH6vi3roB1uluZUhqLUnhmYNUR367GXVixg,16696
31
- xiaogpt-3.5.dist-info/RECORD,,
31
+ xiaogpt-3.10.dist-info/RECORD,,
File without changes