cognify-code 0.2.4__py3-none-any.whl → 0.2.6__py3-none-any.whl
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.
- ai_code_assistant/agent/code_agent.py +31 -334
- ai_code_assistant/cli.py +92 -11
- ai_code_assistant/context/__init__.py +12 -0
- ai_code_assistant/context/analyzer.py +363 -0
- ai_code_assistant/context/selector.py +309 -0
- ai_code_assistant/providers/base.py +94 -4
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/METADATA +94 -161
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/RECORD +12 -9
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/WHEEL +0 -0
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/entry_points.txt +0 -0
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/licenses/LICENSE +0 -0
- {cognify_code-0.2.4.dist-info → cognify_code-0.2.6.dist-info}/top_level.txt +0 -0
|
@@ -3,10 +3,20 @@
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
from enum import Enum
|
|
5
5
|
from typing import Any, Dict, Iterator, List, Optional
|
|
6
|
+
import logging
|
|
6
7
|
|
|
7
8
|
from langchain_core.language_models import BaseChatModel
|
|
8
9
|
from langchain_core.messages import BaseMessage, HumanMessage, SystemMessage
|
|
9
10
|
from pydantic import BaseModel
|
|
11
|
+
from tenacity import (
|
|
12
|
+
retry,
|
|
13
|
+
stop_after_attempt,
|
|
14
|
+
wait_exponential,
|
|
15
|
+
retry_if_exception_type,
|
|
16
|
+
before_sleep_log,
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
logger = logging.getLogger(__name__)
|
|
10
20
|
|
|
11
21
|
|
|
12
22
|
class ProviderType(str, Enum):
|
|
@@ -39,6 +49,21 @@ class ModelInfo(BaseModel):
|
|
|
39
49
|
is_free: bool = True
|
|
40
50
|
|
|
41
51
|
|
|
52
|
+
def _is_retryable_error(exception: Exception) -> bool:
|
|
53
|
+
"""Check if an exception should trigger a retry."""
|
|
54
|
+
error_msg = str(exception).lower()
|
|
55
|
+
# Rate limits, temporary server issues, timeout errors
|
|
56
|
+
retryable_keywords = [
|
|
57
|
+
"rate limit", "rate_limit", "429",
|
|
58
|
+
"503", "502", "504",
|
|
59
|
+
"timeout", "timed out",
|
|
60
|
+
"temporarily unavailable",
|
|
61
|
+
"server error", "internal error",
|
|
62
|
+
"connection", "network",
|
|
63
|
+
]
|
|
64
|
+
return any(keyword in error_msg for keyword in retryable_keywords)
|
|
65
|
+
|
|
66
|
+
|
|
42
67
|
class BaseProvider(ABC):
|
|
43
68
|
"""Abstract base class for LLM providers."""
|
|
44
69
|
|
|
@@ -52,6 +77,11 @@ class BaseProvider(ABC):
|
|
|
52
77
|
# Available models for this provider
|
|
53
78
|
available_models: List[ModelInfo] = []
|
|
54
79
|
|
|
80
|
+
# Retry settings for cloud providers
|
|
81
|
+
_retry_attempts: int = 3
|
|
82
|
+
_retry_min_wait: int = 2
|
|
83
|
+
_retry_max_wait: int = 30
|
|
84
|
+
|
|
55
85
|
def __init__(self, config: ProviderConfig):
|
|
56
86
|
"""Initialize the provider with configuration."""
|
|
57
87
|
self.config = config
|
|
@@ -74,6 +104,10 @@ class BaseProvider(ABC):
|
|
|
74
104
|
"""Validate the provider configuration. Returns (is_valid, error_message)."""
|
|
75
105
|
pass
|
|
76
106
|
|
|
107
|
+
def _should_retry(self) -> bool:
|
|
108
|
+
"""Check if this provider should use retry logic (cloud providers only)."""
|
|
109
|
+
return self.provider_type != ProviderType.OLLAMA
|
|
110
|
+
|
|
77
111
|
def invoke(self, prompt: str, system_prompt: Optional[str] = None) -> str:
|
|
78
112
|
"""Invoke the LLM with a prompt and optional system message."""
|
|
79
113
|
messages: List[BaseMessage] = []
|
|
@@ -81,8 +115,33 @@ class BaseProvider(ABC):
|
|
|
81
115
|
messages.append(SystemMessage(content=system_prompt))
|
|
82
116
|
messages.append(HumanMessage(content=prompt))
|
|
83
117
|
|
|
84
|
-
|
|
85
|
-
|
|
118
|
+
if self._should_retry():
|
|
119
|
+
return self._invoke_with_retry(messages)
|
|
120
|
+
else:
|
|
121
|
+
response = self.llm.invoke(messages)
|
|
122
|
+
return str(response.content)
|
|
123
|
+
|
|
124
|
+
def _invoke_with_retry(self, messages: List[BaseMessage]) -> str:
|
|
125
|
+
"""Invoke with exponential backoff retry for cloud providers."""
|
|
126
|
+
@retry(
|
|
127
|
+
stop=stop_after_attempt(self._retry_attempts),
|
|
128
|
+
wait=wait_exponential(multiplier=1, min=self._retry_min_wait, max=self._retry_max_wait),
|
|
129
|
+
retry=retry_if_exception_type(Exception),
|
|
130
|
+
before_sleep=before_sleep_log(logger, logging.WARNING),
|
|
131
|
+
reraise=True,
|
|
132
|
+
)
|
|
133
|
+
def _do_invoke():
|
|
134
|
+
try:
|
|
135
|
+
response = self.llm.invoke(messages)
|
|
136
|
+
return str(response.content)
|
|
137
|
+
except Exception as e:
|
|
138
|
+
if _is_retryable_error(e):
|
|
139
|
+
logger.warning(f"Retryable error from {self.provider_type.value}: {e}")
|
|
140
|
+
raise # Will be retried
|
|
141
|
+
else:
|
|
142
|
+
raise # Non-retryable, will not retry
|
|
143
|
+
|
|
144
|
+
return _do_invoke()
|
|
86
145
|
|
|
87
146
|
def stream(self, prompt: str, system_prompt: Optional[str] = None) -> Iterator[str]:
|
|
88
147
|
"""Stream LLM response for real-time output."""
|
|
@@ -91,8 +150,39 @@ class BaseProvider(ABC):
|
|
|
91
150
|
messages.append(SystemMessage(content=system_prompt))
|
|
92
151
|
messages.append(HumanMessage(content=prompt))
|
|
93
152
|
|
|
94
|
-
|
|
95
|
-
yield
|
|
153
|
+
if self._should_retry():
|
|
154
|
+
yield from self._stream_with_retry(messages)
|
|
155
|
+
else:
|
|
156
|
+
for chunk in self.llm.stream(messages):
|
|
157
|
+
yield str(chunk.content)
|
|
158
|
+
|
|
159
|
+
def _stream_with_retry(self, messages: List[BaseMessage]) -> Iterator[str]:
|
|
160
|
+
"""Stream with retry logic for cloud providers."""
|
|
161
|
+
last_exception = None
|
|
162
|
+
|
|
163
|
+
for attempt in range(self._retry_attempts):
|
|
164
|
+
try:
|
|
165
|
+
for chunk in self.llm.stream(messages):
|
|
166
|
+
yield str(chunk.content)
|
|
167
|
+
return # Success, exit
|
|
168
|
+
except Exception as e:
|
|
169
|
+
last_exception = e
|
|
170
|
+
if _is_retryable_error(e) and attempt < self._retry_attempts - 1:
|
|
171
|
+
import time
|
|
172
|
+
wait_time = min(
|
|
173
|
+
self._retry_max_wait,
|
|
174
|
+
self._retry_min_wait * (2 ** attempt)
|
|
175
|
+
)
|
|
176
|
+
logger.warning(
|
|
177
|
+
f"Retryable error from {self.provider_type.value}: {e}. "
|
|
178
|
+
f"Retrying in {wait_time}s (attempt {attempt + 1}/{self._retry_attempts})"
|
|
179
|
+
)
|
|
180
|
+
time.sleep(wait_time)
|
|
181
|
+
else:
|
|
182
|
+
raise
|
|
183
|
+
|
|
184
|
+
if last_exception:
|
|
185
|
+
raise last_exception
|
|
96
186
|
|
|
97
187
|
def check_connection(self) -> bool:
|
|
98
188
|
"""Check if the provider is accessible."""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognify-code
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.6
|
|
4
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
5
|
Author-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
6
6
|
Maintainer-email: Ashok Kumar <akkssy@users.noreply.github.com>
|
|
@@ -39,6 +39,7 @@ Requires-Dist: rich>=13.0.0
|
|
|
39
39
|
Requires-Dist: pyyaml>=6.0
|
|
40
40
|
Requires-Dist: pydantic>=2.0.0
|
|
41
41
|
Requires-Dist: pydantic-settings>=2.0.0
|
|
42
|
+
Requires-Dist: tenacity>=8.0.0
|
|
42
43
|
Requires-Dist: chromadb>=0.4.0
|
|
43
44
|
Requires-Dist: sentence-transformers>=2.0.0
|
|
44
45
|
Requires-Dist: watchdog>=4.0.0
|
|
@@ -68,11 +69,11 @@ Dynamic: license-file
|
|
|
68
69
|
|
|
69
70
|
<p align="center">
|
|
70
71
|
<a href="#features">Features</a> •
|
|
72
|
+
<a href="#vscode-extension">VSCode Extension</a> •
|
|
71
73
|
<a href="#installation">Installation</a> •
|
|
72
74
|
<a href="#providers">Providers</a> •
|
|
73
75
|
<a href="#usage">Usage</a> •
|
|
74
|
-
<a href="#documentation">Docs</a>
|
|
75
|
-
<a href="#contributing">Contributing</a>
|
|
76
|
+
<a href="#documentation">Docs</a>
|
|
76
77
|
</p>
|
|
77
78
|
|
|
78
79
|
<p align="center">
|
|
@@ -80,11 +81,12 @@ Dynamic: license-file
|
|
|
80
81
|
<img src="https://img.shields.io/badge/license-MIT-green.svg" alt="MIT License">
|
|
81
82
|
<img src="https://img.shields.io/badge/tests-144%20passed-brightgreen.svg" alt="Tests">
|
|
82
83
|
<img src="https://img.shields.io/badge/providers-6%20supported-purple.svg" alt="6 Providers">
|
|
84
|
+
<img src="https://img.shields.io/badge/VSCode-Extension-blue.svg" alt="VSCode Extension">
|
|
83
85
|
</p>
|
|
84
86
|
|
|
85
87
|
---
|
|
86
88
|
|
|
87
|
-
A powerful CLI tool that brings AI-powered code cognition to your
|
|
89
|
+
A powerful CLI tool and **VSCode extension** that brings AI-powered code cognition to your development workflow. 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
90
|
|
|
89
91
|
## ✨ Features
|
|
90
92
|
|
|
@@ -95,10 +97,67 @@ A powerful CLI tool that brings AI-powered code cognition to your terminal. Revi
|
|
|
95
97
|
| 🔎 **Semantic Search** | Search your codebase using natural language queries |
|
|
96
98
|
| 📝 **AI File Editing** | Edit files with natural language instructions |
|
|
97
99
|
| 🔄 **Multi-File Refactor** | Refactor across multiple files at once |
|
|
98
|
-
|
|
|
100
|
+
| ✏️ **Symbol Renaming** | Rename functions, classes, variables across your project |
|
|
99
101
|
| 💬 **Interactive Chat** | Chat with AI about your code |
|
|
100
102
|
| 📊 **Codebase Indexing** | Create searchable semantic index with RAG |
|
|
101
103
|
| 🌐 **Multi-Provider** | Support for 6 LLM providers (local & cloud) |
|
|
104
|
+
| 🖥️ **VSCode Extension** | Full IDE integration with sidebar chat |
|
|
105
|
+
|
|
106
|
+
## 🖥️ VSCode Extension
|
|
107
|
+
|
|
108
|
+
<p align="center">
|
|
109
|
+
<img src="vscode-extension/images/icon.png" width="64" alt="Cognify VSCode">
|
|
110
|
+
</p>
|
|
111
|
+
|
|
112
|
+
The Cognify AI VSCode extension brings all the power of Cognify directly into your IDE with a beautiful sidebar chat interface.
|
|
113
|
+
|
|
114
|
+
### Extension Features
|
|
115
|
+
|
|
116
|
+
- ⚛️ **Sidebar Chat Panel** - Chat with AI directly in VSCode sidebar
|
|
117
|
+
- 📎 **Add Context** - Include code from your editor in conversations
|
|
118
|
+
- 🔍 **Code Review** - Review files with inline diagnostics
|
|
119
|
+
- ✨ **Code Generation** - Generate code from descriptions
|
|
120
|
+
- 💡 **Code Explanation** - Get explanations for selected code
|
|
121
|
+
- ✏️ **AI Editing** - Edit code with natural language
|
|
122
|
+
|
|
123
|
+
### Quick Actions
|
|
124
|
+
- 📋 Review current file
|
|
125
|
+
- 💡 Explain selected code
|
|
126
|
+
- ✨ Suggest improvements
|
|
127
|
+
- 🧪 Generate tests
|
|
128
|
+
|
|
129
|
+
### Install VSCode Extension
|
|
130
|
+
|
|
131
|
+
```bash
|
|
132
|
+
# Build from source
|
|
133
|
+
cd vscode-extension
|
|
134
|
+
npm install
|
|
135
|
+
npm run package
|
|
136
|
+
|
|
137
|
+
# Install the extension
|
|
138
|
+
code --install-extension cognify-ai-0.2.0.vsix
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Or install via VSCode:
|
|
142
|
+
1. Open VSCode
|
|
143
|
+
2. Go to Extensions sidebar
|
|
144
|
+
3. Click "..." → "Install from VSIX..."
|
|
145
|
+
4. Select `cognify-ai-0.2.0.vsix`
|
|
146
|
+
|
|
147
|
+
### Using the Extension
|
|
148
|
+
|
|
149
|
+
1. Click the ⚛️ Cognify icon in the Activity Bar (left sidebar)
|
|
150
|
+
2. Use quick actions or type your question
|
|
151
|
+
3. Click "📎 Add Context" to include code from your editor
|
|
152
|
+
4. Press Enter or click Send
|
|
153
|
+
|
|
154
|
+
**Keyboard Shortcuts:**
|
|
155
|
+
| Command | Mac | Windows/Linux |
|
|
156
|
+
|---------|-----|---------------|
|
|
157
|
+
| Review File | `Cmd+Shift+R` | `Ctrl+Shift+R` |
|
|
158
|
+
| Generate Code | `Cmd+Shift+G` | `Ctrl+Shift+G` |
|
|
159
|
+
| Explain Code | `Cmd+Shift+E` | `Ctrl+Shift+E` |
|
|
160
|
+
| Open Chat | `Cmd+Shift+C` | `Ctrl+Shift+C` |
|
|
102
161
|
|
|
103
162
|
## 🤖 Supported Providers
|
|
104
163
|
|
|
@@ -153,87 +212,46 @@ pip install -e .
|
|
|
153
212
|
|
|
154
213
|
```bash
|
|
155
214
|
# Check status and available providers
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
## 🌐 Provider Management
|
|
161
|
-
|
|
162
|
-
### List Available Providers
|
|
163
|
-
```bash
|
|
164
|
-
ai-assist providers
|
|
215
|
+
cognify status
|
|
216
|
+
cognify providers
|
|
165
217
|
```
|
|
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
218
|
|
|
173
|
-
|
|
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
|
|
219
|
+
## 📖 CLI Usage
|
|
187
220
|
|
|
188
221
|
### Code Review
|
|
189
222
|
```bash
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
cognify review path/to/file.py
|
|
224
|
+
cognify review src/ --format json
|
|
192
225
|
```
|
|
193
226
|
|
|
194
227
|
### Code Generation
|
|
195
228
|
```bash
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
ai-assist generate "unit tests for calculator" --mode test
|
|
229
|
+
cognify generate "binary search function" --language python
|
|
230
|
+
cognify generate "REST API client class" --mode class
|
|
199
231
|
```
|
|
200
232
|
|
|
201
233
|
### Semantic Search
|
|
202
234
|
```bash
|
|
203
235
|
# First, index your codebase
|
|
204
|
-
|
|
236
|
+
cognify index .
|
|
205
237
|
|
|
206
238
|
# Then search
|
|
207
|
-
|
|
208
|
-
ai-assist search "database connection" -k 10
|
|
239
|
+
cognify search "error handling"
|
|
209
240
|
```
|
|
210
241
|
|
|
211
242
|
### File Editing
|
|
212
243
|
```bash
|
|
213
|
-
|
|
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"
|
|
244
|
+
cognify edit config.py "add logging to all functions" --preview
|
|
227
245
|
```
|
|
228
246
|
|
|
229
247
|
### Interactive Chat
|
|
230
248
|
```bash
|
|
231
|
-
|
|
249
|
+
cognify chat
|
|
232
250
|
```
|
|
233
251
|
|
|
234
252
|
### All Commands
|
|
235
253
|
```bash
|
|
236
|
-
|
|
254
|
+
cognify --help
|
|
237
255
|
```
|
|
238
256
|
|
|
239
257
|
## ⚙️ Configuration
|
|
@@ -242,32 +260,11 @@ Configuration is managed via `config.yaml`:
|
|
|
242
260
|
|
|
243
261
|
```yaml
|
|
244
262
|
llm:
|
|
245
|
-
provider: "ollama"
|
|
263
|
+
provider: "ollama"
|
|
246
264
|
model: "deepseek-coder:6.7b"
|
|
247
|
-
base_url: "http://localhost:11434"
|
|
265
|
+
base_url: "http://localhost:11434"
|
|
248
266
|
temperature: 0.1
|
|
249
267
|
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
268
|
```
|
|
272
269
|
|
|
273
270
|
Or use environment variables:
|
|
@@ -281,100 +278,36 @@ export GROQ_API_KEY="your-key"
|
|
|
281
278
|
|
|
282
279
|
```
|
|
283
280
|
cognify-ai/
|
|
284
|
-
├── src/ai_code_assistant/
|
|
285
|
-
│ ├── cli.py
|
|
286
|
-
│ ├──
|
|
287
|
-
│ ├──
|
|
288
|
-
│ ├──
|
|
289
|
-
│
|
|
290
|
-
│
|
|
291
|
-
│
|
|
292
|
-
|
|
293
|
-
│
|
|
294
|
-
│
|
|
295
|
-
│
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
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
|
|
281
|
+
├── src/ai_code_assistant/ # Core Python package
|
|
282
|
+
│ ├── cli.py # Command-line interface
|
|
283
|
+
│ ├── providers/ # LLM providers
|
|
284
|
+
│ ├── reviewer/ # Code review
|
|
285
|
+
│ ├── generator/ # Code generation
|
|
286
|
+
│ ├── retrieval/ # Semantic search
|
|
287
|
+
│ ├── editor/ # AI file editing
|
|
288
|
+
│ └── chat/ # Interactive chat
|
|
289
|
+
├── vscode-extension/ # VSCode Extension
|
|
290
|
+
│ ├── src/ # Extension source
|
|
291
|
+
│ ├── images/ # Icons
|
|
292
|
+
│ └── package.json # Extension manifest
|
|
293
|
+
├── tests/ # Unit tests
|
|
294
|
+
├── docs/ # Documentation
|
|
295
|
+
└── config.yaml # Configuration
|
|
308
296
|
```
|
|
309
297
|
|
|
310
298
|
## 🧪 Testing
|
|
311
299
|
|
|
312
300
|
```bash
|
|
313
|
-
# Run all tests
|
|
314
301
|
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
302
|
```
|
|
355
303
|
|
|
356
304
|
## 🤝 Contributing
|
|
357
305
|
|
|
358
306
|
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
359
307
|
|
|
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
308
|
## 📄 License
|
|
367
309
|
|
|
368
|
-
|
|
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
|
|
310
|
+
MIT License - see [LICENSE](LICENSE) for details.
|
|
378
311
|
|
|
379
312
|
---
|
|
380
313
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
ai_code_assistant/__init__.py,sha256=XnpG4h-2gW3cXseFvqQT_-XyOmVJtikVMrHUnmy8XKI,409
|
|
2
|
-
ai_code_assistant/cli.py,sha256=
|
|
2
|
+
ai_code_assistant/cli.py,sha256=vrz1zt8JbNXflXVpcSr1ZF_SphBrAPTwDcn-qGR5vfU,67912
|
|
3
3
|
ai_code_assistant/config.py,sha256=6sAufexwzfCu2JNWvt9KevS9k_gMcjj1TAnwuaO1ZFw,4727
|
|
4
4
|
ai_code_assistant/llm.py,sha256=DfcWJf6zEAUsPSEZLdEmb9o6BQNf1Ja88nswjpy6cOw,4209
|
|
5
5
|
ai_code_assistant/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
ai_code_assistant/agent/__init__.py,sha256=BcVe4Ebopv_J01ApnRl05oN5yOet5mEefBrQmdPsUj0,1284
|
|
7
|
-
ai_code_assistant/agent/code_agent.py,sha256=
|
|
7
|
+
ai_code_assistant/agent/code_agent.py,sha256=lykEvcbGl9V4RdKp2sCrP8-jlL-C7mIqvcAwpXHjcSY,28518
|
|
8
8
|
ai_code_assistant/agent/code_generator.py,sha256=rAaziRU-mJ5NooERjR_Cd6_hwO0kuULw3Sp8Ca9kR48,13138
|
|
9
9
|
ai_code_assistant/agent/code_reviewer.py,sha256=YiM7lRJhoN-vBnQb29jF-5nmE9ppL-OJffvx4ocTHEU,12066
|
|
10
10
|
ai_code_assistant/agent/diff_engine.py,sha256=A5jszowc5VmWbdidpIW_QhswG_Hats3FYuemP8VoYv4,11018
|
|
@@ -13,6 +13,9 @@ ai_code_assistant/agent/intent_classifier.py,sha256=MuIcyWQntocrTlCb4CD54mhc3JfS
|
|
|
13
13
|
ai_code_assistant/chat/__init__.py,sha256=KntIXcjbPgznax1E0fvdrA3XtKF-hCz5Fr1tcRbdl7U,279
|
|
14
14
|
ai_code_assistant/chat/agent_session.py,sha256=-sW78d0nifRBNO6PRDiqdd8Sqpkv98kedvZbBQzK3lo,8674
|
|
15
15
|
ai_code_assistant/chat/session.py,sha256=5JRd1DuLjxbtckmsMeHzNjoEZnJS9lx9NoX6z03F0xE,5500
|
|
16
|
+
ai_code_assistant/context/__init__.py,sha256=k7e5N3Ms-93BpDyHlQsavjT1_L9T1xrNRXEGTIwQOrE,294
|
|
17
|
+
ai_code_assistant/context/analyzer.py,sha256=3l0uAzHRkMLBh_5qVlwx82wOjS8QHuUnIzhBxa501mE,13095
|
|
18
|
+
ai_code_assistant/context/selector.py,sha256=WmpTcXE0nzPOgEIwrItAwVhHG0f7N_SVpBJ3984VJqo,10783
|
|
16
19
|
ai_code_assistant/editor/__init__.py,sha256=892BfTIo6kLdfZdhnvl4OFe0QSnxE4EyfkBoyLdA5rc,340
|
|
17
20
|
ai_code_assistant/editor/diff_handler.py,sha256=LeI-00GuH7ASIetsUzT3Y_pDq4K1wmycuu4UFu5ZkGg,8759
|
|
18
21
|
ai_code_assistant/editor/file_editor.py,sha256=csD8MW0jrfXAek5blWNuot_QWlhkgTTmtQtf8rbIdhY,11143
|
|
@@ -24,7 +27,7 @@ ai_code_assistant/git/__init__.py,sha256=YgqmzneAnZyRrbazMqGoFSPIk5Yf5OTm2LXPbkQ
|
|
|
24
27
|
ai_code_assistant/git/commit_generator.py,sha256=CzDH5ZPqEaXyPznBg8FgTz8wbV4adALUQD__kl8au6o,4135
|
|
25
28
|
ai_code_assistant/git/manager.py,sha256=BYeYSz3yPpeJJESy2Zmu4MKEvJ5YAtw3HAmU6uba3nM,6815
|
|
26
29
|
ai_code_assistant/providers/__init__.py,sha256=T8eLHOcjWvqNxLsD8uLmU2H1mJbGbZgUrUcrrVRcqPs,832
|
|
27
|
-
ai_code_assistant/providers/base.py,sha256=
|
|
30
|
+
ai_code_assistant/providers/base.py,sha256=Ep0ZXT2u3_nGUKItAMjf4fxDh2kDRT5CXaZn9P1r6Ys,7279
|
|
28
31
|
ai_code_assistant/providers/cerebras.py,sha256=PfjfFtkFOip5OquyOnxlSQowpy8uPWNRLA6y4m-iYio,3098
|
|
29
32
|
ai_code_assistant/providers/factory.py,sha256=U2zH3HFDGhed2nPRpTyDqG4JcFNHvTvxw25NER2NEi0,4579
|
|
30
33
|
ai_code_assistant/providers/google.py,sha256=nEHsAUiBhV9TjtJEwxkMWydtnWiouVtl_2MrcU8GQNI,3344
|
|
@@ -47,9 +50,9 @@ ai_code_assistant/reviewer/prompts.py,sha256=9RrHEBttS5ngxY2BNsUvqGC6-cTxco-kDPb
|
|
|
47
50
|
ai_code_assistant/utils/__init__.py,sha256=3HO-1Bj4VvUtM7W1C3MKR4DzQ9Xc875QKSHHkHwuqVs,368
|
|
48
51
|
ai_code_assistant/utils/file_handler.py,sha256=jPxvtI5dJxkpPjELgRJ11WXamtyKKmZANQ1fcfMVtiU,5239
|
|
49
52
|
ai_code_assistant/utils/formatters.py,sha256=5El9ew9HS6JLBucBUxxcw4fO5nLpOucgNJrJj2NC3zw,8945
|
|
50
|
-
cognify_code-0.2.
|
|
51
|
-
cognify_code-0.2.
|
|
52
|
-
cognify_code-0.2.
|
|
53
|
-
cognify_code-0.2.
|
|
54
|
-
cognify_code-0.2.
|
|
55
|
-
cognify_code-0.2.
|
|
53
|
+
cognify_code-0.2.6.dist-info/licenses/LICENSE,sha256=5yu_kWq2bK-XKhWo79Eykdg4Qf3O8V2Ys7cpOO7GyyE,1063
|
|
54
|
+
cognify_code-0.2.6.dist-info/METADATA,sha256=JD70dP-OBqiN8_VPo0T1qp-Ifw1OsQLesAD4sruE7vk,10189
|
|
55
|
+
cognify_code-0.2.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
56
|
+
cognify_code-0.2.6.dist-info/entry_points.txt,sha256=MrBnnWPHZVozqqKyTlnJO63YN2kE5yPWKlr2nnRFRks,94
|
|
57
|
+
cognify_code-0.2.6.dist-info/top_level.txt,sha256=dD_r1x-oX0s1uspYY72kig4jfIsjh3oDKwOBCMYXqpo,18
|
|
58
|
+
cognify_code-0.2.6.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|