sopel-ai 1.0.9__py3-none-any.whl → 1.0.10__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
sopel_ai/__init__.py CHANGED
@@ -13,11 +13,11 @@ from sopel_ai.errors import M0tokoError
13
13
  from tinydb import Query
14
14
  from tinydb import TinyDB
15
15
 
16
- import logging
16
+ # import logging
17
17
  import os
18
18
 
19
19
 
20
- __VERSION__ = '1.0.9'
20
+ __VERSION__ = '1.0.10'
21
21
 
22
22
 
23
23
  # +++ constants +++
@@ -28,16 +28,22 @@ DEFAULT_LLM_PROVIDER = 'PerplexityAI'
28
28
  DEFAULT_LLM_SERVICE = PERPLEXITY_API_URL
29
29
  DEFAULT_LOG_LEVEL = 'info'
30
30
  GITHUB_NEW_ISSUE_URL = 'https://github.com/pr3d4t0r/sopel_ai/issues/new'
31
- LOGGER = logging.getLogger(__name__)
32
31
  MAX_RESPONSE_LENGTH = 448
33
32
  USER_DB_FILE = os.path.join('/', os.environ['HOME'], '.sopel/sopel_ai-DB.json')
34
33
 
35
34
 
35
+ # +++ initializations +++
36
+
37
+ # logging.basicConfig(format = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s', encoding = 'utf-8', level = logging.INFO)
38
+
39
+
40
+
36
41
  # +++ globals +++
37
42
 
38
43
  _client = None
39
44
  _clientCache = dict()
40
45
  _database = None
46
+ # _log = logging.getLogger(__name__)
41
47
 
42
48
 
43
49
  # +++ implementation +++
@@ -82,7 +88,9 @@ def runQuery(query: str, nick: str = None) -> str:
82
88
  Python run-time.
83
89
  """
84
90
 
85
- if not nick or getModelForUser(nick, USER_DB_FILE) == DEFAULT_LLM:
91
+ model = getModelForUser(nick, USER_DB_FILE)
92
+ print('*** nick = %s, query = %s, model = %s' % (nick, query, model))
93
+ if not nick or model == DEFAULT_LLM:
86
94
  _checkClientInstance()
87
95
  client = _client
88
96
  else:
sopel_ai/plugin.py CHANGED
@@ -52,7 +52,7 @@ def _queryCommand(bot: SopelWrapper, trigger: Trigger) -> None:
52
52
  return
53
53
 
54
54
  # TODO: Log this
55
- bot.reply(runQuery(trigger.group(2)))
55
+ bot.reply(runQuery(trigger.group(2), trigger.nick))
56
56
 
57
57
 
58
58
  @plugin.commands('qpm', 'llmqpm')
@@ -66,7 +66,7 @@ def _queryCommandPrivateMessage(bot: SopelWrapper, trigger: Trigger) -> None:
66
66
  bot.reply('No search term. Usage: {}qpm Some question about anything'.format(bot.config.core.help_prefix))
67
67
  return
68
68
 
69
- bot.say(runQuery(trigger.group(2)), trigger.nick)
69
+ bot.say(runQuery(trigger.group(2), trigger.nick), trigger.nick)
70
70
 
71
71
 
72
72
  @plugin.commands('mver')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sopel-ai
3
- Version: 1.0.9
3
+ Version: 1.0.10
4
4
  Summary: Sopel AI - an LLM enhanced chat bot plug-in
5
5
  Author-email: The SopelAI team <sopel_ai@cime.net>
6
6
  Project-URL: Homepage, https://github.com/pr3d4t0r/sopel_ai
@@ -23,7 +23,7 @@ Requires-Dist: perplexipy
23
23
  Requires-Dist: sopel (>=7.1)
24
24
  Requires-Dist: tinydb
25
25
 
26
- % sopel_ai(1) Version 1.0.9 chatbot plugin
26
+ % sopel_ai(1) Version 1.0.10 chatbot plugin
27
27
 
28
28
  Name
29
29
  ====
@@ -0,0 +1,10 @@
1
+ sopel_ai/__init__.py,sha256=COsPkQDg6ftVLhY4j4vVaoX6bCon1ViqS6Bxzzz7HLU,5813
2
+ sopel_ai/config.py,sha256=DOL1Eqj1ctUgCrLW3TvInP3NFbvQm7ARoNKWB0ulTgU,698
3
+ sopel_ai/errors.py,sha256=fgc9mjYJMnq1AxFXOwiknFwnJBJTWRNkZIHzRKS9m5g,191
4
+ sopel_ai/plugin.py,sha256=C-NEKwC1NtBSUoQF-ulape_TptVsSafm4Mps0LRYcLk,5800
5
+ sopel_ai-1.0.10.dist-info/LICENSE.txt,sha256=Zu2THICc4hWm3NlzcKss5xjgku2JwQ0sUDYQZ9Pjhcw,1522
6
+ sopel_ai-1.0.10.dist-info/METADATA,sha256=7JfcxrD4LAqODMdNMZTquSNeq_KP_3vE1QHRt4N9Srw,1623
7
+ sopel_ai-1.0.10.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
8
+ sopel_ai-1.0.10.dist-info/entry_points.txt,sha256=7Juxcn6L4j6F83TjkviiTwiyXLM4gZxAAXFQDR2G_m4,43
9
+ sopel_ai-1.0.10.dist-info/top_level.txt,sha256=kpNMzNEGbhCXkyn7oc3uQPmrX1J6qLxn59IcZBpwSYg,9
10
+ sopel_ai-1.0.10.dist-info/RECORD,,
@@ -1,10 +0,0 @@
1
- sopel_ai/__init__.py,sha256=E4MS1AZk2gg5qGpypQzITjKzkdXeWLQ9VNvpUsKmm4Y,5561
2
- sopel_ai/config.py,sha256=DOL1Eqj1ctUgCrLW3TvInP3NFbvQm7ARoNKWB0ulTgU,698
3
- sopel_ai/errors.py,sha256=fgc9mjYJMnq1AxFXOwiknFwnJBJTWRNkZIHzRKS9m5g,191
4
- sopel_ai/plugin.py,sha256=ZCFfsK0RJbWNeQQ8ReMd-as30jOT6smdWaxp2DS5f6g,5772
5
- sopel_ai-1.0.9.dist-info/LICENSE.txt,sha256=Zu2THICc4hWm3NlzcKss5xjgku2JwQ0sUDYQZ9Pjhcw,1522
6
- sopel_ai-1.0.9.dist-info/METADATA,sha256=2puOlWV7LK2EKzsPF3iRLgFMzp3spvfopAcRjqsmogw,1621
7
- sopel_ai-1.0.9.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
8
- sopel_ai-1.0.9.dist-info/entry_points.txt,sha256=7Juxcn6L4j6F83TjkviiTwiyXLM4gZxAAXFQDR2G_m4,43
9
- sopel_ai-1.0.9.dist-info/top_level.txt,sha256=kpNMzNEGbhCXkyn7oc3uQPmrX1J6qLxn59IcZBpwSYg,9
10
- sopel_ai-1.0.9.dist-info/RECORD,,