TeLLMgramBot 2.4.3__tar.gz → 2.4.4__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.
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/PKG-INFO +5 -5
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/README.md +3 -2
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/initialize.py +33 -10
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot.egg-info/PKG-INFO +5 -5
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot.egg-info/requires.txt +0 -1
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/setup.py +2 -3
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/LICENSE +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/TeLLMgramBot.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/__init__.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/conversation.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/message_handlers.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/providers/__init__.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/providers/anthropic_provider.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/providers/base.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/providers/factory.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/providers/openai_provider.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/tokenGPT.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/utils.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot/web_utils.py +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot.egg-info/SOURCES.txt +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot.egg-info/dependency_links.txt +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/TeLLMgramBot.egg-info/top_level.txt +0 -0
- {tellmgrambot-2.4.3 → tellmgrambot-2.4.4}/setup.cfg +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TeLLMgramBot
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.4
|
|
4
4
|
Summary: LLM-powered Telegram bot (OpenAI + Anthropic)
|
|
5
5
|
Home-page: https://github.com/Digital-Heresy/TeLLMgramBot
|
|
6
6
|
Author: Digital Heresy
|
|
7
7
|
Author-email: ronin.atx@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
Requires-Dist: openai>2.0
|
|
@@ -14,7 +14,6 @@ Requires-Dist: anthropic>=0.40
|
|
|
14
14
|
Requires-Dist: PyYAML
|
|
15
15
|
Requires-Dist: httpx
|
|
16
16
|
Requires-Dist: beautifulsoup4
|
|
17
|
-
Requires-Dist: typing
|
|
18
17
|
Requires-Dist: validators
|
|
19
18
|
Requires-Dist: tiktoken>=0.12
|
|
20
19
|
Requires-Dist: python-telegram-bot>20.0
|
|
@@ -75,7 +74,8 @@ When initializing TeLLMgramBot, the following directories get created:
|
|
|
75
74
|
* On first run, GPT and Claude model families are pre-populated. Additional models can be added manually.
|
|
76
75
|
* `prompts` - Contains prompt files for how the bot interacts with any user.
|
|
77
76
|
* `test_personality.prmpt` (can be a different name)
|
|
78
|
-
* A sample prompt file
|
|
77
|
+
* A sample prompt file defining the bot's personality: generic, helpful, and multi-provider-aware.
|
|
78
|
+
* The prompt emphasizes the bot's ability to fetch and analyze URLs passed in square brackets `[]`.
|
|
79
79
|
* The user can create more prompt files as needed for different personalities.
|
|
80
80
|
* `url_analysis.prmpt`
|
|
81
81
|
* Prompt template used to analyze URL content passed in brackets `[]`.
|
|
@@ -126,7 +126,7 @@ This means the user can implement whatever key vault they want to fetch the keys
|
|
|
126
126
|
### API Key Files
|
|
127
127
|
The other route is to create files by the base path during execution or a specified environment variable `TELLMGRAMBOT_KEYS_PATH`. By default, files are created for the user to input each API key:
|
|
128
128
|
1. `openai.key`
|
|
129
|
-
2. `anthropic.key`
|
|
129
|
+
2. `anthropic.key`
|
|
130
130
|
3. `telegram.key`
|
|
131
131
|
4. `virustotal.key`
|
|
132
132
|
|
|
@@ -44,7 +44,8 @@ When initializing TeLLMgramBot, the following directories get created:
|
|
|
44
44
|
* On first run, GPT and Claude model families are pre-populated. Additional models can be added manually.
|
|
45
45
|
* `prompts` - Contains prompt files for how the bot interacts with any user.
|
|
46
46
|
* `test_personality.prmpt` (can be a different name)
|
|
47
|
-
* A sample prompt file
|
|
47
|
+
* A sample prompt file defining the bot's personality: generic, helpful, and multi-provider-aware.
|
|
48
|
+
* The prompt emphasizes the bot's ability to fetch and analyze URLs passed in square brackets `[]`.
|
|
48
49
|
* The user can create more prompt files as needed for different personalities.
|
|
49
50
|
* `url_analysis.prmpt`
|
|
50
51
|
* Prompt template used to analyze URL content passed in brackets `[]`.
|
|
@@ -95,7 +96,7 @@ This means the user can implement whatever key vault they want to fetch the keys
|
|
|
95
96
|
### API Key Files
|
|
96
97
|
The other route is to create files by the base path during execution or a specified environment variable `TELLMGRAMBOT_KEYS_PATH`. By default, files are created for the user to input each API key:
|
|
97
98
|
1. `openai.key`
|
|
98
|
-
2. `anthropic.key`
|
|
99
|
+
2. `anthropic.key`
|
|
99
100
|
3. `telegram.key`
|
|
100
101
|
4. `virustotal.key`
|
|
101
102
|
|
|
@@ -16,7 +16,12 @@ INIT_BOT_CONFIG = {
|
|
|
16
16
|
'url_model': 'gpt-5',
|
|
17
17
|
'token_limit': None,
|
|
18
18
|
'persona_temp': None,
|
|
19
|
-
'persona_prompt': 'You are a test
|
|
19
|
+
'persona_prompt': 'You are a generic test bot powered by a user-configured LLM.'
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
INIT_BOT_CONFIG_COMMENTS = {
|
|
23
|
+
'token_limit': '# Optional, overrides the chat_model\'s default max token limit',
|
|
24
|
+
'persona_temp': '# Optional, LLM temperature 0.0-2.0 (default: model\'s default)',
|
|
20
25
|
}
|
|
21
26
|
|
|
22
27
|
def execution_dir() -> str:
|
|
@@ -138,7 +143,21 @@ def init_keys():
|
|
|
138
143
|
def init_bot_config(file='config.yaml') -> str:
|
|
139
144
|
"""
|
|
140
145
|
Ensure bot configuration file (default 'config.yaml') is created.
|
|
141
|
-
|
|
146
|
+
|
|
147
|
+
Creates a basic bot configuration file in TELLMGRAMBOT_CONFIGS_PATH with default values
|
|
148
|
+
and inline parameter comments. Optional parameters (those with None values in INIT_BOT_CONFIG)
|
|
149
|
+
are populated with descriptions from INIT_BOT_CONFIG_COMMENTS instead of values, helping
|
|
150
|
+
users understand when to set them.
|
|
151
|
+
|
|
152
|
+
Args:
|
|
153
|
+
file: Name of the configuration file to create (default: 'config.yaml').
|
|
154
|
+
|
|
155
|
+
Returns:
|
|
156
|
+
Path to the created or existing configuration file.
|
|
157
|
+
|
|
158
|
+
Raises:
|
|
159
|
+
SystemExit: If TELLMGRAMBOT_CONFIGS_PATH environment variable is not defined,
|
|
160
|
+
or if file creation fails.
|
|
142
161
|
"""
|
|
143
162
|
env_var = "TELLMGRAMBOT_CONFIGS_PATH"
|
|
144
163
|
try:
|
|
@@ -151,10 +170,10 @@ def init_bot_config(file='config.yaml') -> str:
|
|
|
151
170
|
for parameter, value in INIT_BOT_CONFIG.items():
|
|
152
171
|
if parameter == 'persona_prompt':
|
|
153
172
|
continue
|
|
154
|
-
else: # Write parameter, with
|
|
173
|
+
else: # Write parameter, with inline comment if no value
|
|
155
174
|
f.write('%s : %s\n' % (
|
|
156
175
|
parameter.ljust(12),
|
|
157
|
-
value if value else '# Optional
|
|
176
|
+
value if value else INIT_BOT_CONFIG_COMMENTS.get(parameter, '# Optional')
|
|
158
177
|
))
|
|
159
178
|
return path
|
|
160
179
|
except KeyError:
|
|
@@ -211,9 +230,9 @@ def init_bot_prompt(file='test_personality.prmpt') -> str:
|
|
|
211
230
|
env_var = "TELLMGRAMBOT_PROMPTS_PATH"
|
|
212
231
|
try:
|
|
213
232
|
return generate_file_path(os.environ[env_var], file, "bot personality prompt",
|
|
214
|
-
"You are a test
|
|
215
|
-
"
|
|
216
|
-
"
|
|
233
|
+
"You are a generic test bot powered by a user-configured LLM. "
|
|
234
|
+
"You respond helpfully to messages and, when a URL is provided in [square brackets], "
|
|
235
|
+
"you fetch and analyze its contents after verifying it is safe via VirusTotal.\n"
|
|
217
236
|
)
|
|
218
237
|
except KeyError:
|
|
219
238
|
sys.exit(f"{env_var} must be defined to create file '{file}'! Exiting...")
|
|
@@ -246,10 +265,14 @@ def init_url_prompt(file='url_analysis.prmpt') -> str:
|
|
|
246
265
|
|
|
247
266
|
def init_structure():
|
|
248
267
|
"""
|
|
249
|
-
Performs the whole TeLLMgramBot setup including:
|
|
268
|
+
Performs the whole TeLLMgramBot first-run setup including:
|
|
250
269
|
- Directories for configurations, prompts, and conversation/error logs.
|
|
251
|
-
- OpenAI
|
|
252
|
-
-
|
|
270
|
+
- Provider-conditional API keys (OpenAI/Anthropic determined by config.yaml model prefixes).
|
|
271
|
+
- Configuration files (config.yaml, tokenGPT.yaml) with inline parameter descriptions.
|
|
272
|
+
- System prompt files (test_personality.prmpt, url_analysis.prmpt).
|
|
273
|
+
|
|
274
|
+
Provider key requirements are inferred from config.yaml model prefixes (claude-* → Anthropic,
|
|
275
|
+
gpt-* → OpenAI, etc.) to streamline setup for single-provider deployments.
|
|
253
276
|
"""
|
|
254
277
|
init_directories()
|
|
255
278
|
init_keys()
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: TeLLMgramBot
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.4
|
|
4
4
|
Summary: LLM-powered Telegram bot (OpenAI + Anthropic)
|
|
5
5
|
Home-page: https://github.com/Digital-Heresy/TeLLMgramBot
|
|
6
6
|
Author: Digital Heresy
|
|
7
7
|
Author-email: ronin.atx@gmail.com
|
|
8
8
|
License: MIT
|
|
9
|
-
Requires-Python: >=3.
|
|
9
|
+
Requires-Python: >=3.10
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
License-File: LICENSE
|
|
12
12
|
Requires-Dist: openai>2.0
|
|
@@ -14,7 +14,6 @@ Requires-Dist: anthropic>=0.40
|
|
|
14
14
|
Requires-Dist: PyYAML
|
|
15
15
|
Requires-Dist: httpx
|
|
16
16
|
Requires-Dist: beautifulsoup4
|
|
17
|
-
Requires-Dist: typing
|
|
18
17
|
Requires-Dist: validators
|
|
19
18
|
Requires-Dist: tiktoken>=0.12
|
|
20
19
|
Requires-Dist: python-telegram-bot>20.0
|
|
@@ -75,7 +74,8 @@ When initializing TeLLMgramBot, the following directories get created:
|
|
|
75
74
|
* On first run, GPT and Claude model families are pre-populated. Additional models can be added manually.
|
|
76
75
|
* `prompts` - Contains prompt files for how the bot interacts with any user.
|
|
77
76
|
* `test_personality.prmpt` (can be a different name)
|
|
78
|
-
* A sample prompt file
|
|
77
|
+
* A sample prompt file defining the bot's personality: generic, helpful, and multi-provider-aware.
|
|
78
|
+
* The prompt emphasizes the bot's ability to fetch and analyze URLs passed in square brackets `[]`.
|
|
79
79
|
* The user can create more prompt files as needed for different personalities.
|
|
80
80
|
* `url_analysis.prmpt`
|
|
81
81
|
* Prompt template used to analyze URL content passed in brackets `[]`.
|
|
@@ -126,7 +126,7 @@ This means the user can implement whatever key vault they want to fetch the keys
|
|
|
126
126
|
### API Key Files
|
|
127
127
|
The other route is to create files by the base path during execution or a specified environment variable `TELLMGRAMBOT_KEYS_PATH`. By default, files are created for the user to input each API key:
|
|
128
128
|
1. `openai.key`
|
|
129
|
-
2. `anthropic.key`
|
|
129
|
+
2. `anthropic.key`
|
|
130
130
|
3. `telegram.key`
|
|
131
131
|
4. `virustotal.key`
|
|
132
132
|
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setup(
|
|
7
7
|
name='TeLLMgramBot',
|
|
8
|
-
version='2.4.
|
|
8
|
+
version='2.4.4',
|
|
9
9
|
packages=find_packages(),
|
|
10
10
|
license='MIT',
|
|
11
11
|
author='Digital Heresy',
|
|
@@ -20,10 +20,9 @@ setup(
|
|
|
20
20
|
'PyYAML',
|
|
21
21
|
'httpx',
|
|
22
22
|
'beautifulsoup4',
|
|
23
|
-
'typing',
|
|
24
23
|
'validators',
|
|
25
24
|
'tiktoken>=0.12',
|
|
26
25
|
'python-telegram-bot>20.0'
|
|
27
26
|
],
|
|
28
|
-
python_requires='>=3.
|
|
27
|
+
python_requires='>=3.10'
|
|
29
28
|
)
|
|
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
|