ai-logmaster 1.0.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Your Name
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,340 @@
1
+ Metadata-Version: 2.4
2
+ Name: ai-logmaster
3
+ Version: 1.0.0
4
+ Summary: Smart error analysis tool with AI-powered solutions
5
+ Home-page: https://github.com/Divodude/ai-logmaster
6
+ Author: Divyansh
7
+ Author-email: ry604492@gmail.com
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: Topic :: Software Development :: Debuggers
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Requires-Python: >=3.8
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: langchain>=1.0.0
21
+ Requires-Dist: langchain-community>=0.4.0
22
+ Requires-Dist: langchain-core>=1.2.0
23
+ Requires-Dist: langchain-openai>=1.0.0
24
+ Requires-Dist: langgraph>=1.0.0
25
+ Requires-Dist: duckduckgo-search>=8.0.0
26
+ Requires-Dist: pyyaml>=6.0
27
+ Requires-Dist: python-dotenv>=1.0.0
28
+ Requires-Dist: requests>=2.32.0
29
+ Provides-Extra: rag
30
+ Requires-Dist: faiss-cpu>=1.13.0; extra == "rag"
31
+ Requires-Dist: beautifulsoup4>=4.12.0; extra == "rag"
32
+ Requires-Dist: lxml>=6.0.0; extra == "rag"
33
+ Provides-Extra: dev
34
+ Requires-Dist: pytest>=7.0.0; extra == "dev"
35
+ Requires-Dist: black>=23.0.0; extra == "dev"
36
+ Requires-Dist: flake8>=6.0.0; extra == "dev"
37
+ Dynamic: author
38
+ Dynamic: author-email
39
+ Dynamic: classifier
40
+ Dynamic: description
41
+ Dynamic: description-content-type
42
+ Dynamic: home-page
43
+ Dynamic: license-file
44
+ Dynamic: provides-extra
45
+ Dynamic: requires-dist
46
+ Dynamic: requires-python
47
+ Dynamic: summary
48
+
49
+ # AI LogMaster
50
+
51
+ **Smart error analysis tool with AI-powered solutions**
52
+
53
+ Wrap any command and get instant, intelligent debugging help powered by AI and documentation retrieval.
54
+
55
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
56
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
57
+
58
+ ## Features
59
+
60
+ - 🤖 **AI-Powered Analysis** - Uses LangChain and LLMs for intelligent error diagnosis
61
+ - 📚 **Smart Documentation Retrieval** - Automatically fetches relevant docs when needed
62
+ - 💰 **API Quota Optimization** - Intelligent agent minimizes API calls (70-80% reduction)
63
+ - ⚡ **Zero Setup** - Just wrap your command and go
64
+ - 🔧 **Multi-Provider Support** - Works with OpenAI, Anthropic, Google, NVIDIA, and more
65
+ - 🎯 **Pattern-Based Caching** - Common errors use cached solutions (no API calls)
66
+
67
+ ## Installation
68
+
69
+ ```bash
70
+ pip install ai-logmaster
71
+ ```
72
+
73
+ ## Quick Start
74
+
75
+ ### 1. Initialize Configuration
76
+
77
+ ```bash
78
+ logmaster init
79
+ ```
80
+
81
+ This creates `~/.ai-logmaster/config.yaml`. Edit it to set your API key:
82
+
83
+ ```yaml
84
+ ai:
85
+ provider: "nvidia"
86
+ api_key: "your-api-key-here"
87
+ ```
88
+
89
+ Or use environment variable:
90
+ ```bash
91
+ export NVIDIA_API_KEY="your-api-key"
92
+ ```
93
+
94
+ ### 2. Run Your Command
95
+
96
+ ```bash
97
+ logmaster run "python your_script.py"
98
+ ```
99
+
100
+ That's it! The tool will:
101
+ 1. ✅ Execute your command
102
+ 2. ✅ Capture output in real-time
103
+ 3. ✅ Detect errors automatically
104
+ 4. ✅ Analyze with AI
105
+ 5. ✅ Show solutions with documentation references
106
+
107
+ ## Example Output
108
+
109
+ ```
110
+ [TRIAGE] Executing: python broken.py
111
+ ============================================================
112
+ [ERROR] TypeError: unsupported operand type(s) for /: 'int' and 'str'
113
+ ============================================================
114
+
115
+ [TRIAGE] ⚠️ Error detected! Analyzing...
116
+
117
+ [AGENT] Classifying error type...
118
+ [AGENT] Error type: type, Needs docs: True
119
+ [AGENT] Fetching documentation from web...
120
+ [AGENT] ✓ Fetched 989 chars of documentation
121
+ [AGENT] Analyzing with AI...
122
+ [AGENT] ✓ Analysis complete (API calls: 1)
123
+
124
+ ╔══════════════════════════════════════════════════════════╗
125
+ ║ 🔍 DIAGNOSIS ║
126
+ ╠══════════════════════════════════════════════════════════╣
127
+ ║ Type: TypeError ║
128
+ ║ Confidence: 90% ║
129
+ ║ Method: AI + Docs ║
130
+ ╠══════════════════════════════════════════════════════════╣
131
+ ║ 📋 ROOT CAUSE ║
132
+ ╠══════════════════════════════════════════════════════════╣
133
+ ║ Division operation between integer and string ║
134
+ ╠══════════════════════════════════════════════════════════╣
135
+ ║ 💡 RECOMMENDED FIXES ║
136
+ ╠══════════════════════════════════════════════════════════╣
137
+ ║ 1. Ensure divisor is numeric type ║
138
+ ║ 2. Convert string to int/float if needed ║
139
+ ║ 3. Validate inputs before operations ║
140
+ ╠══════════════════════════════════════════════════════════╣
141
+ ║ 📚 DOCUMENTATION SOURCES ║
142
+ ╠══════════════════════════════════════════════════════════╣
143
+ ║ • https://docs.python.org/3/library/exceptions.html ║
144
+ ╚══════════════════════════════════════════════════════════╝
145
+ ```
146
+
147
+ ## Configuration
148
+
149
+ ### AI Providers
150
+
151
+ Edit `~/.ai-logmaster/config.yaml`:
152
+
153
+ #### NVIDIA (Default - Free Tier Available)
154
+ ```yaml
155
+ ai:
156
+ provider: "nvidia"
157
+ model: "mistralai/mistral-small-3.1-24b-instruct-2503"
158
+ api_key: "${NVIDIA_API_KEY}"
159
+ base_url: "https://integrate.api.nvidia.com/v1"
160
+ ```
161
+
162
+ #### OpenAI
163
+ ```yaml
164
+ ai:
165
+ provider: "openai"
166
+ model: "gpt-4"
167
+ api_key: "${OPENAI_API_KEY}"
168
+ ```
169
+
170
+ #### Anthropic
171
+ ```yaml
172
+ ai:
173
+ provider: "anthropic"
174
+ model: "claude-3-opus-20240229"
175
+ api_key: "${ANTHROPIC_API_KEY}"
176
+ ```
177
+
178
+ #### Google
179
+ ```yaml
180
+ ai:
181
+ provider: "google"
182
+ model: "gemini-pro"
183
+ api_key: "${GOOGLE_API_KEY}"
184
+ ```
185
+
186
+ ### Agent Optimization
187
+
188
+ Control when AI is used to minimize API costs:
189
+
190
+ ```yaml
191
+ agent:
192
+ use_cached_solutions: true # Use cached solutions for common errors
193
+ fetch_documentation: true # Fetch docs from web
194
+
195
+ # These errors use cached solutions (0 API calls)
196
+ cached_error_types:
197
+ - connection
198
+ - import
199
+ - memory
200
+ - timeout
201
+ - permission
202
+
203
+ # These errors use AI + docs (1 API call each)
204
+ complex_error_types:
205
+ - syntax
206
+ - type
207
+ - value
208
+ - unknown
209
+ ```
210
+
211
+ ### Quota Management
212
+
213
+ ```yaml
214
+ quota:
215
+ enabled: true
216
+ daily_limit: 100 # Maximum API calls per day
217
+ warn_threshold: 0.8 # Warn at 80%
218
+ ```
219
+
220
+ ## How It Works
221
+
222
+ ### Smart Agent Flow
223
+
224
+ ```
225
+ Error Detected
226
+ ↓
227
+ Classify Error (Pattern Matching - FREE)
228
+ ↓
229
+ ├─→ Common Error? → Use Cached Solution (0 API calls)
230
+ │
231
+ └─→ Complex/Unknown? → Fetch Docs (FREE) → AI Analysis (1 API call)
232
+ ```
233
+
234
+ ### API Call Optimization
235
+
236
+ **Without Agent**: Every error = 1 API call
237
+
238
+ **With Agent**:
239
+ - Connection errors: 0 API calls ✅
240
+ - Import errors: 0 API calls ✅
241
+ - Memory errors: 0 API calls ✅
242
+ - Timeout errors: 0 API calls ✅
243
+ - Permission errors: 0 API calls ✅
244
+ - Syntax errors: 1 API call 💰
245
+ - Type errors: 1 API call 💰
246
+ - Unknown errors: 1 API call 💰
247
+
248
+ **Result**: 70-80% reduction in API calls!
249
+
250
+ ## Usage Examples
251
+
252
+ ### Python Script
253
+ ```bash
254
+ logmaster run "python app.py"
255
+ ```
256
+
257
+ ### Node.js Application
258
+ ```bash
259
+ logmaster run "node server.js"
260
+ ```
261
+
262
+ ### Shell Script
263
+ ```bash
264
+ logmaster run "bash deploy.sh"
265
+ ```
266
+
267
+ ### Complex Command
268
+ ```bash
269
+ logmaster run "npm run build && npm start"
270
+ ```
271
+
272
+ ### With Custom Buffer Size
273
+ ```bash
274
+ logmaster run "python script.py" --buffer 200
275
+ ```
276
+
277
+ ## Advanced Features
278
+
279
+ ### RAG Support (Optional)
280
+
281
+ Install with RAG capabilities for enhanced documentation retrieval:
282
+
283
+ ```bash
284
+ pip install ai-logmaster[rag]
285
+ ```
286
+
287
+ Enable in config:
288
+ ```yaml
289
+ rag:
290
+ enabled: true
291
+ vector_store: "faiss"
292
+ chunk_size: 1000
293
+ top_k: 3
294
+ ```
295
+
296
+ ## Development
297
+
298
+ ### Install from Source
299
+
300
+ ```bash
301
+ git clone https://github.com/Divodude/ai-logmaster.git
302
+ cd ai-logmaster
303
+ pip install -e .
304
+ ```
305
+
306
+ ### Run Tests
307
+
308
+ ```bash
309
+ python run_agent_tests.py
310
+ ```
311
+
312
+ ## Requirements
313
+
314
+ - Python 3.8+
315
+ - API key for your chosen AI provider (NVIDIA, OpenAI, Anthropic, or Google)
316
+
317
+ ## License
318
+
319
+ MIT License - see [LICENSE](LICENSE) file for details.
320
+
321
+ ## Contributing
322
+
323
+ Contributions welcome! Please open an issue or PR.
324
+
325
+ ## Support
326
+
327
+ - 📧 Email: ry604492@gmail.com
328
+ - 🐛 Issues: https://github.com/Divodude/ai-logmaster/issues
329
+ - 📖 Docs: https://github.com/Divodude/ai-logmaster
330
+
331
+ ## Acknowledgments
332
+
333
+ Built with:
334
+ - [LangChain](https://github.com/langchain-ai/langchain) - LLM framework
335
+ - [LangGraph](https://github.com/langchain-ai/langgraph) - Agent orchestration
336
+ - [DuckDuckGo Search](https://github.com/deedy5/duckduckgo_search) - Documentation retrieval
337
+
338
+ ---
339
+
340
+ **Made with ❤️ by Divyansh**
@@ -0,0 +1,292 @@
1
+ # AI LogMaster
2
+
3
+ **Smart error analysis tool with AI-powered solutions**
4
+
5
+ Wrap any command and get instant, intelligent debugging help powered by AI and documentation retrieval.
6
+
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
8
+ [![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)
9
+
10
+ ## Features
11
+
12
+ - 🤖 **AI-Powered Analysis** - Uses LangChain and LLMs for intelligent error diagnosis
13
+ - 📚 **Smart Documentation Retrieval** - Automatically fetches relevant docs when needed
14
+ - 💰 **API Quota Optimization** - Intelligent agent minimizes API calls (70-80% reduction)
15
+ - ⚡ **Zero Setup** - Just wrap your command and go
16
+ - 🔧 **Multi-Provider Support** - Works with OpenAI, Anthropic, Google, NVIDIA, and more
17
+ - 🎯 **Pattern-Based Caching** - Common errors use cached solutions (no API calls)
18
+
19
+ ## Installation
20
+
21
+ ```bash
22
+ pip install ai-logmaster
23
+ ```
24
+
25
+ ## Quick Start
26
+
27
+ ### 1. Initialize Configuration
28
+
29
+ ```bash
30
+ logmaster init
31
+ ```
32
+
33
+ This creates `~/.ai-logmaster/config.yaml`. Edit it to set your API key:
34
+
35
+ ```yaml
36
+ ai:
37
+ provider: "nvidia"
38
+ api_key: "your-api-key-here"
39
+ ```
40
+
41
+ Or use environment variable:
42
+ ```bash
43
+ export NVIDIA_API_KEY="your-api-key"
44
+ ```
45
+
46
+ ### 2. Run Your Command
47
+
48
+ ```bash
49
+ logmaster run "python your_script.py"
50
+ ```
51
+
52
+ That's it! The tool will:
53
+ 1. ✅ Execute your command
54
+ 2. ✅ Capture output in real-time
55
+ 3. ✅ Detect errors automatically
56
+ 4. ✅ Analyze with AI
57
+ 5. ✅ Show solutions with documentation references
58
+
59
+ ## Example Output
60
+
61
+ ```
62
+ [TRIAGE] Executing: python broken.py
63
+ ============================================================
64
+ [ERROR] TypeError: unsupported operand type(s) for /: 'int' and 'str'
65
+ ============================================================
66
+
67
+ [TRIAGE] ⚠️ Error detected! Analyzing...
68
+
69
+ [AGENT] Classifying error type...
70
+ [AGENT] Error type: type, Needs docs: True
71
+ [AGENT] Fetching documentation from web...
72
+ [AGENT] ✓ Fetched 989 chars of documentation
73
+ [AGENT] Analyzing with AI...
74
+ [AGENT] ✓ Analysis complete (API calls: 1)
75
+
76
+ ╔══════════════════════════════════════════════════════════╗
77
+ ║ 🔍 DIAGNOSIS ║
78
+ ╠══════════════════════════════════════════════════════════╣
79
+ ║ Type: TypeError ║
80
+ ║ Confidence: 90% ║
81
+ ║ Method: AI + Docs ║
82
+ ╠══════════════════════════════════════════════════════════╣
83
+ ║ 📋 ROOT CAUSE ║
84
+ ╠══════════════════════════════════════════════════════════╣
85
+ ║ Division operation between integer and string ║
86
+ ╠══════════════════════════════════════════════════════════╣
87
+ ║ 💡 RECOMMENDED FIXES ║
88
+ ╠══════════════════════════════════════════════════════════╣
89
+ ║ 1. Ensure divisor is numeric type ║
90
+ ║ 2. Convert string to int/float if needed ║
91
+ ║ 3. Validate inputs before operations ║
92
+ ╠══════════════════════════════════════════════════════════╣
93
+ ║ 📚 DOCUMENTATION SOURCES ║
94
+ ╠══════════════════════════════════════════════════════════╣
95
+ ║ • https://docs.python.org/3/library/exceptions.html ║
96
+ ╚══════════════════════════════════════════════════════════╝
97
+ ```
98
+
99
+ ## Configuration
100
+
101
+ ### AI Providers
102
+
103
+ Edit `~/.ai-logmaster/config.yaml`:
104
+
105
+ #### NVIDIA (Default - Free Tier Available)
106
+ ```yaml
107
+ ai:
108
+ provider: "nvidia"
109
+ model: "mistralai/mistral-small-3.1-24b-instruct-2503"
110
+ api_key: "${NVIDIA_API_KEY}"
111
+ base_url: "https://integrate.api.nvidia.com/v1"
112
+ ```
113
+
114
+ #### OpenAI
115
+ ```yaml
116
+ ai:
117
+ provider: "openai"
118
+ model: "gpt-4"
119
+ api_key: "${OPENAI_API_KEY}"
120
+ ```
121
+
122
+ #### Anthropic
123
+ ```yaml
124
+ ai:
125
+ provider: "anthropic"
126
+ model: "claude-3-opus-20240229"
127
+ api_key: "${ANTHROPIC_API_KEY}"
128
+ ```
129
+
130
+ #### Google
131
+ ```yaml
132
+ ai:
133
+ provider: "google"
134
+ model: "gemini-pro"
135
+ api_key: "${GOOGLE_API_KEY}"
136
+ ```
137
+
138
+ ### Agent Optimization
139
+
140
+ Control when AI is used to minimize API costs:
141
+
142
+ ```yaml
143
+ agent:
144
+ use_cached_solutions: true # Use cached solutions for common errors
145
+ fetch_documentation: true # Fetch docs from web
146
+
147
+ # These errors use cached solutions (0 API calls)
148
+ cached_error_types:
149
+ - connection
150
+ - import
151
+ - memory
152
+ - timeout
153
+ - permission
154
+
155
+ # These errors use AI + docs (1 API call each)
156
+ complex_error_types:
157
+ - syntax
158
+ - type
159
+ - value
160
+ - unknown
161
+ ```
162
+
163
+ ### Quota Management
164
+
165
+ ```yaml
166
+ quota:
167
+ enabled: true
168
+ daily_limit: 100 # Maximum API calls per day
169
+ warn_threshold: 0.8 # Warn at 80%
170
+ ```
171
+
172
+ ## How It Works
173
+
174
+ ### Smart Agent Flow
175
+
176
+ ```
177
+ Error Detected
178
+ ↓
179
+ Classify Error (Pattern Matching - FREE)
180
+ ↓
181
+ ├─→ Common Error? → Use Cached Solution (0 API calls)
182
+ │
183
+ └─→ Complex/Unknown? → Fetch Docs (FREE) → AI Analysis (1 API call)
184
+ ```
185
+
186
+ ### API Call Optimization
187
+
188
+ **Without Agent**: Every error = 1 API call
189
+
190
+ **With Agent**:
191
+ - Connection errors: 0 API calls ✅
192
+ - Import errors: 0 API calls ✅
193
+ - Memory errors: 0 API calls ✅
194
+ - Timeout errors: 0 API calls ✅
195
+ - Permission errors: 0 API calls ✅
196
+ - Syntax errors: 1 API call 💰
197
+ - Type errors: 1 API call 💰
198
+ - Unknown errors: 1 API call 💰
199
+
200
+ **Result**: 70-80% reduction in API calls!
201
+
202
+ ## Usage Examples
203
+
204
+ ### Python Script
205
+ ```bash
206
+ logmaster run "python app.py"
207
+ ```
208
+
209
+ ### Node.js Application
210
+ ```bash
211
+ logmaster run "node server.js"
212
+ ```
213
+
214
+ ### Shell Script
215
+ ```bash
216
+ logmaster run "bash deploy.sh"
217
+ ```
218
+
219
+ ### Complex Command
220
+ ```bash
221
+ logmaster run "npm run build && npm start"
222
+ ```
223
+
224
+ ### With Custom Buffer Size
225
+ ```bash
226
+ logmaster run "python script.py" --buffer 200
227
+ ```
228
+
229
+ ## Advanced Features
230
+
231
+ ### RAG Support (Optional)
232
+
233
+ Install with RAG capabilities for enhanced documentation retrieval:
234
+
235
+ ```bash
236
+ pip install ai-logmaster[rag]
237
+ ```
238
+
239
+ Enable in config:
240
+ ```yaml
241
+ rag:
242
+ enabled: true
243
+ vector_store: "faiss"
244
+ chunk_size: 1000
245
+ top_k: 3
246
+ ```
247
+
248
+ ## Development
249
+
250
+ ### Install from Source
251
+
252
+ ```bash
253
+ git clone https://github.com/Divodude/ai-logmaster.git
254
+ cd ai-logmaster
255
+ pip install -e .
256
+ ```
257
+
258
+ ### Run Tests
259
+
260
+ ```bash
261
+ python run_agent_tests.py
262
+ ```
263
+
264
+ ## Requirements
265
+
266
+ - Python 3.8+
267
+ - API key for your chosen AI provider (NVIDIA, OpenAI, Anthropic, or Google)
268
+
269
+ ## License
270
+
271
+ MIT License - see [LICENSE](LICENSE) file for details.
272
+
273
+ ## Contributing
274
+
275
+ Contributions welcome! Please open an issue or PR.
276
+
277
+ ## Support
278
+
279
+ - 📧 Email: ry604492@gmail.com
280
+ - 🐛 Issues: https://github.com/Divodude/ai-logmaster/issues
281
+ - 📖 Docs: https://github.com/Divodude/ai-logmaster
282
+
283
+ ## Acknowledgments
284
+
285
+ Built with:
286
+ - [LangChain](https://github.com/langchain-ai/langchain) - LLM framework
287
+ - [LangGraph](https://github.com/langchain-ai/langgraph) - Agent orchestration
288
+ - [DuckDuckGo Search](https://github.com/deedy5/duckduckgo_search) - Documentation retrieval
289
+
290
+ ---
291
+
292
+ **Made with ❤️ by Divyansh**
@@ -0,0 +1,10 @@
1
+ """
2
+ AI LogMaster - Smart Error Analysis with AI-Powered Solutions
3
+ """
4
+
5
+ __version__ = "1.0.0"
6
+ __author__ = "Your Name"
7
+
8
+ from .config import get_config, init_config
9
+
10
+ __all__ = ["get_config", "init_config"]