xiaogpt 3.5__tar.gz → 3.10__tar.gz

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.
Files changed (30) hide show
  1. {xiaogpt-3.5 → xiaogpt-3.10}/PKG-INFO +1 -1
  2. {xiaogpt-3.5 → xiaogpt-3.10}/pyproject.toml +1 -1
  3. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/gemini_bot.py +8 -4
  4. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/config.py +1 -0
  5. {xiaogpt-3.5 → xiaogpt-3.10}/LICENSE +0 -0
  6. {xiaogpt-3.5 → xiaogpt-3.10}/README.md +0 -0
  7. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/__init__.py +0 -0
  8. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/__main__.py +0 -0
  9. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/__init__.py +0 -0
  10. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/base_bot.py +0 -0
  11. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/chatgptapi_bot.py +0 -0
  12. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/doubao_bot.py +0 -0
  13. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/glm_bot.py +0 -0
  14. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/langchain_bot.py +0 -0
  15. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/llama_bot.py +0 -0
  16. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/moonshot_bot.py +0 -0
  17. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/qwen_bot.py +0 -0
  18. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/bot/yi_bot.py +0 -0
  19. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/cli.py +0 -0
  20. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/langchain/callbacks.py +0 -0
  21. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/langchain/chain.py +0 -0
  22. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/langchain/examples/email/mail_box.py +0 -0
  23. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/langchain/examples/email/mail_summary_tools.py +0 -0
  24. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/tts/__init__.py +0 -0
  25. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/tts/base.py +0 -0
  26. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/tts/file.py +0 -0
  27. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/tts/live.py +0 -0
  28. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/tts/mi.py +0 -0
  29. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/utils.py +0 -0
  30. {xiaogpt-3.5 → xiaogpt-3.10}/xiaogpt/xiaogpt.py +0 -0
@@ -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
@@ -31,7 +31,7 @@ dependencies = [
31
31
  "lingua-language-detector>=2.0.2; python_version < \"3.13\"",
32
32
  ]
33
33
  dynamic = []
34
- version = "3.5"
34
+ version = "3.10"
35
35
 
36
36
  [project.license]
37
37
  text = "MIT"
@@ -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):
@@ -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(
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes