cognify-code 0.2.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.
- cognify_code-0.2.0/LICENSE +22 -0
- cognify_code-0.2.0/MANIFEST.in +9 -0
- cognify_code-0.2.0/PKG-INFO +383 -0
- cognify_code-0.2.0/README.md +321 -0
- cognify_code-0.2.0/pyproject.toml +124 -0
- cognify_code-0.2.0/setup.cfg +4 -0
- cognify_code-0.2.0/src/ai_code_assistant/__init__.py +14 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/__init__.py +63 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/code_agent.py +461 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/code_generator.py +388 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/code_reviewer.py +365 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/diff_engine.py +308 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/file_manager.py +300 -0
- cognify_code-0.2.0/src/ai_code_assistant/agent/intent_classifier.py +284 -0
- cognify_code-0.2.0/src/ai_code_assistant/chat/__init__.py +11 -0
- cognify_code-0.2.0/src/ai_code_assistant/chat/agent_session.py +156 -0
- cognify_code-0.2.0/src/ai_code_assistant/chat/session.py +165 -0
- cognify_code-0.2.0/src/ai_code_assistant/cli.py +1571 -0
- cognify_code-0.2.0/src/ai_code_assistant/config.py +149 -0
- cognify_code-0.2.0/src/ai_code_assistant/editor/__init__.py +8 -0
- cognify_code-0.2.0/src/ai_code_assistant/editor/diff_handler.py +270 -0
- cognify_code-0.2.0/src/ai_code_assistant/editor/file_editor.py +350 -0
- cognify_code-0.2.0/src/ai_code_assistant/editor/prompts.py +146 -0
- cognify_code-0.2.0/src/ai_code_assistant/generator/__init__.py +7 -0
- cognify_code-0.2.0/src/ai_code_assistant/generator/code_gen.py +265 -0
- cognify_code-0.2.0/src/ai_code_assistant/generator/prompts.py +114 -0
- cognify_code-0.2.0/src/ai_code_assistant/git/__init__.py +6 -0
- cognify_code-0.2.0/src/ai_code_assistant/git/commit_generator.py +130 -0
- cognify_code-0.2.0/src/ai_code_assistant/git/manager.py +203 -0
- cognify_code-0.2.0/src/ai_code_assistant/llm.py +111 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/__init__.py +23 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/base.py +124 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/cerebras.py +97 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/factory.py +148 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/google.py +103 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/groq.py +111 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/ollama.py +86 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/openai.py +114 -0
- cognify_code-0.2.0/src/ai_code_assistant/providers/openrouter.py +130 -0
- cognify_code-0.2.0/src/ai_code_assistant/py.typed +0 -0
- cognify_code-0.2.0/src/ai_code_assistant/refactor/__init__.py +20 -0
- cognify_code-0.2.0/src/ai_code_assistant/refactor/analyzer.py +189 -0
- cognify_code-0.2.0/src/ai_code_assistant/refactor/change_plan.py +172 -0
- cognify_code-0.2.0/src/ai_code_assistant/refactor/multi_file_editor.py +346 -0
- cognify_code-0.2.0/src/ai_code_assistant/refactor/prompts.py +175 -0
- cognify_code-0.2.0/src/ai_code_assistant/retrieval/__init__.py +19 -0
- cognify_code-0.2.0/src/ai_code_assistant/retrieval/chunker.py +215 -0
- cognify_code-0.2.0/src/ai_code_assistant/retrieval/indexer.py +236 -0
- cognify_code-0.2.0/src/ai_code_assistant/retrieval/search.py +239 -0
- cognify_code-0.2.0/src/ai_code_assistant/reviewer/__init__.py +7 -0
- cognify_code-0.2.0/src/ai_code_assistant/reviewer/analyzer.py +278 -0
- cognify_code-0.2.0/src/ai_code_assistant/reviewer/prompts.py +113 -0
- cognify_code-0.2.0/src/ai_code_assistant/utils/__init__.py +18 -0
- cognify_code-0.2.0/src/ai_code_assistant/utils/file_handler.py +155 -0
- cognify_code-0.2.0/src/ai_code_assistant/utils/formatters.py +259 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/PKG-INFO +383 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/SOURCES.txt +59 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/dependency_links.txt +1 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/entry_points.txt +3 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/requires.txt +32 -0
- cognify_code-0.2.0/src/cognify_code.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ashok
|
|
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.
|
|
22
|
+
|
|
@@ -0,0 +1,383 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: cognify-code
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Your local AI-powered code assistant. Review, generate, search, and refactor code with an intelligent AI agentโall running locally with complete privacy.
|
|
5
|
+
Author-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
6
|
+
Maintainer-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
7
|
+
License: MIT
|
|
8
|
+
Project-URL: Homepage, https://akkssy.github.io/cognify-ai-website/
|
|
9
|
+
Project-URL: Documentation, https://github.com/akkssy/cognify-ai#readme
|
|
10
|
+
Project-URL: Repository, https://github.com/akkssy/cognify-ai
|
|
11
|
+
Project-URL: Issues, https://github.com/akkssy/cognify-ai/issues
|
|
12
|
+
Project-URL: Changelog, https://github.com/akkssy/cognify-ai/releases
|
|
13
|
+
Keywords: ai,code-review,code-generation,code-assistant,ai-agent,langchain,ollama,groq,gemini,cli,developer-tools,refactoring,semantic-search,local-llm,privacy
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Environment :: Console
|
|
16
|
+
Classifier: Intended Audience :: Developers
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Operating System :: OS Independent
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Topic :: Software Development
|
|
25
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
26
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
27
|
+
Classifier: Topic :: Software Development :: Testing
|
|
28
|
+
Classifier: Topic :: Text Processing :: Linguistic
|
|
29
|
+
Classifier: Typing :: Typed
|
|
30
|
+
Requires-Python: >=3.9
|
|
31
|
+
Description-Content-Type: text/markdown
|
|
32
|
+
License-File: LICENSE
|
|
33
|
+
Requires-Dist: langchain>=0.1.0
|
|
34
|
+
Requires-Dist: langchain-core>=0.1.0
|
|
35
|
+
Requires-Dist: langchain-ollama>=0.1.0
|
|
36
|
+
Requires-Dist: langchain-openai>=0.1.0
|
|
37
|
+
Requires-Dist: click>=8.1.0
|
|
38
|
+
Requires-Dist: rich>=13.0.0
|
|
39
|
+
Requires-Dist: pyyaml>=6.0
|
|
40
|
+
Requires-Dist: pydantic>=2.0.0
|
|
41
|
+
Requires-Dist: pydantic-settings>=2.0.0
|
|
42
|
+
Requires-Dist: chromadb>=0.4.0
|
|
43
|
+
Requires-Dist: sentence-transformers>=2.0.0
|
|
44
|
+
Requires-Dist: watchdog>=4.0.0
|
|
45
|
+
Provides-Extra: google
|
|
46
|
+
Requires-Dist: langchain-google-genai>=1.0.0; extra == "google"
|
|
47
|
+
Provides-Extra: groq
|
|
48
|
+
Requires-Dist: langchain-groq>=0.1.0; extra == "groq"
|
|
49
|
+
Provides-Extra: all-providers
|
|
50
|
+
Requires-Dist: langchain-google-genai>=1.0.0; extra == "all-providers"
|
|
51
|
+
Requires-Dist: langchain-groq>=0.1.0; extra == "all-providers"
|
|
52
|
+
Provides-Extra: dev
|
|
53
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
54
|
+
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
|
|
55
|
+
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
|
|
56
|
+
Requires-Dist: black>=23.0.0; extra == "dev"
|
|
57
|
+
Requires-Dist: ruff>=0.1.0; extra == "dev"
|
|
58
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
59
|
+
Requires-Dist: build>=1.0.0; extra == "dev"
|
|
60
|
+
Requires-Dist: twine>=4.0.0; extra == "dev"
|
|
61
|
+
Dynamic: license-file
|
|
62
|
+
|
|
63
|
+
# ๐ง Cognify AI
|
|
64
|
+
|
|
65
|
+
<p align="center">
|
|
66
|
+
<strong>Code Cognition โ Your AI-Powered Code Assistant</strong>
|
|
67
|
+
</p>
|
|
68
|
+
|
|
69
|
+
<p align="center">
|
|
70
|
+
<a href="#features">Features</a> โข
|
|
71
|
+
<a href="#installation">Installation</a> โข
|
|
72
|
+
<a href="#providers">Providers</a> โข
|
|
73
|
+
<a href="#usage">Usage</a> โข
|
|
74
|
+
<a href="#documentation">Docs</a> โข
|
|
75
|
+
<a href="#contributing">Contributing</a>
|
|
76
|
+
</p>
|
|
77
|
+
|
|
78
|
+
<p align="center">
|
|
79
|
+
<img src="https://img.shields.io/badge/python-3.9+-blue.svg" alt="Python 3.9+">
|
|
80
|
+
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License">
|
|
81
|
+
<img src="https://img.shields.io/badge/tests-144%20passed-brightgreen.svg" alt="Tests">
|
|
82
|
+
<img src="https://img.shields.io/badge/providers-6%20supported-purple.svg" alt="6 Providers">
|
|
83
|
+
</p>
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
A powerful CLI tool that brings AI-powered code cognition to your terminal. Review code, generate functions, search your codebase semantically, and refactor projectsโwith support for **multiple LLM providers** including local (Ollama) and cloud options with free tiers.
|
|
88
|
+
|
|
89
|
+
## โจ Features
|
|
90
|
+
|
|
91
|
+
| Feature | Description |
|
|
92
|
+
|---------|-------------|
|
|
93
|
+
| ๐ **Code Review** | Analyze code for bugs, security issues, and style problems |
|
|
94
|
+
| โก **Code Generation** | Generate functions, classes, and tests from natural language |
|
|
95
|
+
| ๐ **Semantic Search** | Search your codebase using natural language queries |
|
|
96
|
+
| ๐ **AI File Editing** | Edit files with natural language instructions |
|
|
97
|
+
| ๐ **Multi-File Refactor** | Refactor across multiple files at once |
|
|
98
|
+
| ๏ฟฝ๏ฟฝ๏ธ **Symbol Renaming** | Rename functions, classes, variables across your project |
|
|
99
|
+
| ๐ฌ **Interactive Chat** | Chat with AI about your code |
|
|
100
|
+
| ๐ **Codebase Indexing** | Create searchable semantic index with RAG |
|
|
101
|
+
| ๐ **Multi-Provider** | Support for 6 LLM providers (local & cloud) |
|
|
102
|
+
|
|
103
|
+
## ๐ค Supported Providers
|
|
104
|
+
|
|
105
|
+
| Provider | Free Tier | API Key | Best For |
|
|
106
|
+
|----------|-----------|---------|----------|
|
|
107
|
+
| **Ollama** | โ
Unlimited | โ None | Privacy, offline use |
|
|
108
|
+
| **Google AI** | โ
Generous | โ
Required | 1M+ token context |
|
|
109
|
+
| **Groq** | โ
1000 req/day | โ
Required | Fastest inference |
|
|
110
|
+
| **Cerebras** | โ
Available | โ
Required | Fast inference |
|
|
111
|
+
| **OpenRouter** | โ
Free models | โ
Required | Model variety |
|
|
112
|
+
| **OpenAI** | โ Paid only | โ
Required | GPT-4 quality |
|
|
113
|
+
|
|
114
|
+
## ๐ Quick Start
|
|
115
|
+
|
|
116
|
+
### Option 1: Local with Ollama (No API Key)
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
# Install Ollama from https://ollama.ai
|
|
120
|
+
ollama pull deepseek-coder:6.7b
|
|
121
|
+
ollama serve
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
### Option 2: Cloud with Free Tier
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
# Google AI Studio (1M token context, free)
|
|
128
|
+
export GOOGLE_API_KEY="your-key" # Get from https://aistudio.google.com/apikey
|
|
129
|
+
|
|
130
|
+
# OR Groq (fastest inference, free tier)
|
|
131
|
+
export GROQ_API_KEY="your-key" # Get from https://console.groq.com/keys
|
|
132
|
+
|
|
133
|
+
# OR OpenRouter (free models available)
|
|
134
|
+
export OPENROUTER_API_KEY="your-key" # Get from https://openrouter.ai/keys
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Installation
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
# Clone the repository
|
|
141
|
+
git clone https://github.com/akkssy/cognify-ai.git
|
|
142
|
+
cd cognify-ai
|
|
143
|
+
|
|
144
|
+
# Create virtual environment
|
|
145
|
+
python -m venv .venv
|
|
146
|
+
source .venv/bin/activate # On Windows: .venv\Scripts\activate
|
|
147
|
+
|
|
148
|
+
# Install the package
|
|
149
|
+
pip install -e .
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Verify Installation
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
# Check status and available providers
|
|
156
|
+
ai-assist status
|
|
157
|
+
ai-assist providers
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## ๐ Provider Management
|
|
161
|
+
|
|
162
|
+
### List Available Providers
|
|
163
|
+
```bash
|
|
164
|
+
ai-assist providers
|
|
165
|
+
```
|
|
166
|
+
Shows all providers with their models, free tier status, and API key requirements.
|
|
167
|
+
|
|
168
|
+
### Switch Providers
|
|
169
|
+
```bash
|
|
170
|
+
# Switch to Groq (fast cloud inference)
|
|
171
|
+
ai-assist use-provider groq --test
|
|
172
|
+
|
|
173
|
+
# Switch to Google with specific model
|
|
174
|
+
ai-assist use-provider google --model gemini-1.5-pro --test
|
|
175
|
+
|
|
176
|
+
# Use OpenRouter with free DeepSeek R1
|
|
177
|
+
ai-assist use-provider openrouter --model deepseek/deepseek-r1:free --test
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### Test Provider Connection
|
|
181
|
+
```bash
|
|
182
|
+
ai-assist test-provider
|
|
183
|
+
ai-assist test-provider --provider groq --prompt "Hello world"
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
## ๐ Usage
|
|
187
|
+
|
|
188
|
+
### Code Review
|
|
189
|
+
```bash
|
|
190
|
+
ai-assist review path/to/file.py
|
|
191
|
+
ai-assist review src/ --format json
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Code Generation
|
|
195
|
+
```bash
|
|
196
|
+
ai-assist generate "binary search function" --language python
|
|
197
|
+
ai-assist generate "REST API client class" --mode class
|
|
198
|
+
ai-assist generate "unit tests for calculator" --mode test
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### Semantic Search
|
|
202
|
+
```bash
|
|
203
|
+
# First, index your codebase
|
|
204
|
+
ai-assist index .
|
|
205
|
+
|
|
206
|
+
# Then search
|
|
207
|
+
ai-assist search "error handling"
|
|
208
|
+
ai-assist search "database connection" -k 10
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### File Editing
|
|
212
|
+
```bash
|
|
213
|
+
ai-assist edit config.py "add logging to all functions" --preview
|
|
214
|
+
ai-assist edit utils.py "add type hints" --backup
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Multi-File Refactoring
|
|
218
|
+
```bash
|
|
219
|
+
ai-assist refactor "add docstrings to all functions" -p "src/**/*.py" --dry-run
|
|
220
|
+
ai-assist refactor "convert print to logging" --pattern "**/*.py" --confirm
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### Symbol Renaming
|
|
224
|
+
```bash
|
|
225
|
+
ai-assist rename old_function new_function --type function --dry-run
|
|
226
|
+
ai-assist rename MyClass BetterClass --type class -p "src/**/*.py"
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
### Interactive Chat
|
|
230
|
+
```bash
|
|
231
|
+
ai-assist chat
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### All Commands
|
|
235
|
+
```bash
|
|
236
|
+
ai-assist --help
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
## โ๏ธ Configuration
|
|
240
|
+
|
|
241
|
+
Configuration is managed via `config.yaml`:
|
|
242
|
+
|
|
243
|
+
```yaml
|
|
244
|
+
llm:
|
|
245
|
+
provider: "ollama" # ollama, google, groq, cerebras, openrouter, openai
|
|
246
|
+
model: "deepseek-coder:6.7b"
|
|
247
|
+
base_url: "http://localhost:11434" # For Ollama
|
|
248
|
+
temperature: 0.1
|
|
249
|
+
max_tokens: 4096
|
|
250
|
+
timeout: 120
|
|
251
|
+
|
|
252
|
+
review:
|
|
253
|
+
severity_levels: [critical, warning, suggestion]
|
|
254
|
+
categories: [bugs, security, performance, style]
|
|
255
|
+
|
|
256
|
+
generation:
|
|
257
|
+
include_type_hints: true
|
|
258
|
+
include_docstrings: true
|
|
259
|
+
|
|
260
|
+
retrieval:
|
|
261
|
+
embedding_model: "all-MiniLM-L6-v2"
|
|
262
|
+
chunk_size: 50
|
|
263
|
+
|
|
264
|
+
editor:
|
|
265
|
+
create_backup: true
|
|
266
|
+
show_diff: true
|
|
267
|
+
|
|
268
|
+
refactor:
|
|
269
|
+
max_files: 20
|
|
270
|
+
require_confirmation: true
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
Or use environment variables:
|
|
274
|
+
```bash
|
|
275
|
+
export AI_ASSISTANT_LLM_PROVIDER="groq"
|
|
276
|
+
export AI_ASSISTANT_LLM_MODEL="llama-3.3-70b-versatile"
|
|
277
|
+
export GROQ_API_KEY="your-key"
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
## ๐ Project Structure
|
|
281
|
+
|
|
282
|
+
```
|
|
283
|
+
cognify-ai/
|
|
284
|
+
โโโ src/ai_code_assistant/
|
|
285
|
+
โ โโโ cli.py # Command-line interface
|
|
286
|
+
โ โโโ config.py # Configuration management
|
|
287
|
+
โ โโโ llm.py # LLM integration
|
|
288
|
+
โ โโโ providers/ # Multi-provider support
|
|
289
|
+
โ โ โโโ base.py # Provider base class
|
|
290
|
+
โ โ โโโ factory.py # Provider factory
|
|
291
|
+
โ โ โโโ ollama.py # Ollama (local)
|
|
292
|
+
โ โ โโโ google.py # Google AI Studio
|
|
293
|
+
โ โ โโโ groq.py # Groq
|
|
294
|
+
โ โ โโโ cerebras.py # Cerebras
|
|
295
|
+
โ โ โโโ openrouter.py # OpenRouter
|
|
296
|
+
โ โ โโโ openai.py # OpenAI
|
|
297
|
+
โ โโโ reviewer/ # Code review module
|
|
298
|
+
โ โโโ generator/ # Code generation module
|
|
299
|
+
โ โโโ retrieval/ # Semantic search & indexing (RAG)
|
|
300
|
+
โ โโโ editor/ # AI file editing
|
|
301
|
+
โ โโโ refactor/ # Multi-file refactoring
|
|
302
|
+
โ โโโ chat/ # Interactive chat
|
|
303
|
+
โ โโโ utils/ # Utilities & formatters
|
|
304
|
+
โโโ tests/ # 144 unit tests
|
|
305
|
+
โโโ docs/ # Documentation
|
|
306
|
+
โโโ config.yaml # Configuration
|
|
307
|
+
โโโ pyproject.toml # Dependencies
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
## ๐งช Testing
|
|
311
|
+
|
|
312
|
+
```bash
|
|
313
|
+
# Run all tests
|
|
314
|
+
PYTHONPATH=src pytest tests/ -v
|
|
315
|
+
|
|
316
|
+
# Run with coverage
|
|
317
|
+
PYTHONPATH=src pytest tests/ --cov=ai_code_assistant
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
## ๐ ๏ธ Tech Stack
|
|
321
|
+
|
|
322
|
+
| Component | Technology |
|
|
323
|
+
|-----------|------------|
|
|
324
|
+
| LLM Framework | LangChain |
|
|
325
|
+
| Local LLM | Ollama |
|
|
326
|
+
| Cloud LLMs | Google, Groq, OpenRouter, OpenAI |
|
|
327
|
+
| Vector Database | ChromaDB |
|
|
328
|
+
| Embeddings | Sentence Transformers |
|
|
329
|
+
| CLI | Click + Rich |
|
|
330
|
+
| Config | Pydantic |
|
|
331
|
+
| Testing | Pytest |
|
|
332
|
+
|
|
333
|
+
## ๐ Troubleshooting
|
|
334
|
+
|
|
335
|
+
**"Connection refused" error (Ollama)**
|
|
336
|
+
```bash
|
|
337
|
+
ollama serve # Make sure Ollama is running
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
**API Key errors**
|
|
341
|
+
```bash
|
|
342
|
+
ai-assist providers # Check which API keys are set
|
|
343
|
+
export GROQ_API_KEY="your-key" # Set the appropriate key
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
**Test provider connection**
|
|
347
|
+
```bash
|
|
348
|
+
ai-assist test-provider --provider groq
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
**Import errors**
|
|
352
|
+
```bash
|
|
353
|
+
pip install -e ".[dev]"
|
|
354
|
+
```
|
|
355
|
+
|
|
356
|
+
## ๐ค Contributing
|
|
357
|
+
|
|
358
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
359
|
+
|
|
360
|
+
1. Fork the repository
|
|
361
|
+
2. Create your feature branch (`git checkout -b feature/amazing-feature`)
|
|
362
|
+
3. Commit your changes (`git commit -m 'Add amazing feature'`)
|
|
363
|
+
4. Push to the branch (`git push origin feature/amazing-feature`)
|
|
364
|
+
5. Open a Pull Request
|
|
365
|
+
|
|
366
|
+
## ๐ License
|
|
367
|
+
|
|
368
|
+
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.
|
|
369
|
+
|
|
370
|
+
## ๐ Acknowledgments
|
|
371
|
+
|
|
372
|
+
- [Ollama](https://ollama.ai) - Local LLM runtime
|
|
373
|
+
- [LangChain](https://langchain.com) - LLM framework
|
|
374
|
+
- [Google AI Studio](https://aistudio.google.com) - Gemini models
|
|
375
|
+
- [Groq](https://groq.com) - Fast inference
|
|
376
|
+
- [OpenRouter](https://openrouter.ai) - Multi-provider access
|
|
377
|
+
- [ChromaDB](https://www.trychroma.com) - Vector database
|
|
378
|
+
|
|
379
|
+
---
|
|
380
|
+
|
|
381
|
+
<p align="center">
|
|
382
|
+
Made with โค๏ธ for developers who want flexible AI-powered coding assistance
|
|
383
|
+
</p>
|