jarvis-ai-assistant 0.1.58__py3-none-any.whl → 0.1.74__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.

Potentially problematic release.


This version of jarvis-ai-assistant might be problematic. Click here for more details.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: jarvis-ai-assistant
3
- Version: 0.1.58
3
+ Version: 0.1.74
4
4
  Summary: Jarvis: An AI assistant that uses tools to interact with the system
5
5
  Home-page: https://github.com/skyfireitdiy/Jarvis
6
6
  Author: skyfire
@@ -44,6 +44,10 @@ Requires-Dist: colorama>=0.4.6
44
44
  Requires-Dist: prompt_toolkit>=3.0.0
45
45
  Requires-Dist: openai>=1.20.0
46
46
  Requires-Dist: playwright>=1.41.1
47
+ Requires-Dist: numpy>=1.24.0
48
+ Requires-Dist: faiss-cpu>=1.8.0
49
+ Requires-Dist: sentence-transformers>=2.2.2
50
+ Requires-Dist: bs4>=0.0.1
47
51
  Provides-Extra: dev
48
52
  Requires-Dist: pytest; extra == "dev"
49
53
  Requires-Dist: black; extra == "dev"
@@ -66,6 +70,8 @@ Dynamic: requires-python
66
70
 
67
71
  *Your intelligent assistant for development and system interaction*
68
72
 
73
+ English | [简体中文](README_zh.md)
74
+
69
75
  [Features](#features) •
70
76
  [Usage](#usage) •
71
77
  [Configuration](#configuration) •
@@ -112,19 +118,26 @@ pip install jarvis-ai-assistant
112
118
 
113
119
  ## 🔧 Configuration
114
120
 
115
- Create a `.jarvis_env` file in your home directory with your API keys:
121
+ Jarvis supports configuration through environment variables that can be set in the `~/.jarvis_env` file:
122
+
123
+ | Environment Variable | Description | Default Value | Required |
124
+ |---------|------|--------|------|
125
+ | JARVIS_PLATFORM | AI platform to use, supports kimi/openai/ai8 etc | kimi | Yes |
126
+ | JARVIS_MODEL | Model name to use | - | No |
127
+ | JARVIS_CODEGEN_PLATFORM | AI platform for code generation | Same as JARVIS_PLATFORM | No |
128
+ | JARVIS_CODEGEN_MODEL | Model name for code generation | Same as JARVIS_MODEL | No |
129
+ | JARVIS_CHEAP_PLATFORM | AI platform for cheap operations | Same as JARVIS_PLATFORM | No |
130
+ | JARVIS_CHEAP_MODEL | Model name for cheap operations | Same as JARVIS_MODEL | No |
131
+ | JARVIS_EMBEDDING_MODEL | Embedding model for code analysis | BAAI/bge-large-zh-v1.5 | No |
132
+ | OPENAI_API_KEY | API key for OpenAI platform | - | Required for OpenAI |
133
+ | OPENAI_API_BASE | Base URL for OpenAI API | https://api.deepseek.com | No |
134
+ | OPENAI_MODEL_NAME | Model name for OpenAI | deepseek-chat | No |
135
+ | AI8_API_KEY | API key for AI8 platform | - | Required for AI8 |
136
+ | AI8_MODEL | Model name for AI8 platform | deepseek-chat | No |
137
+ | KIMI_API_KEY | API key for Kimi platform | - | Required for Kimi |
138
+ | OYI_API_KEY | API key for OYI platform | - | Required for OYI |
139
+ | OYI_MODEL | Model name for OYI platform | deepseek-chat | No |
116
140
 
117
- ### For Kimi:
118
- ```bash
119
- KIMI_API_KEY=your_kimi_api_key_here
120
- ```
121
-
122
- ### For OpenAI:
123
- ```bash
124
- OPENAI_API_KEY=your_api_key_here
125
- OPENAI_API_BASE=your_api_base # Optional, defaults to https://api.deepseek.com
126
- OPENAI_MODEL_NAME=your_model_name # Optional, defaults to deepseek-chat
127
- ```
128
141
 
129
142
  ## 🎯 Usage
130
143
 
@@ -133,15 +146,26 @@ OPENAI_MODEL_NAME=your_model_name # Optional, defaults to deepseek-chat
133
146
  jarvis
134
147
  ```
135
148
 
149
+
136
150
  ### With Specific Model
137
151
  ```bash
138
152
  jarvis -p kimi # Use Kimi platform
139
153
  jarvis -p openai # Use OpenAI platform
140
154
  ```
141
155
 
142
- ### Process Files
156
+ ### Code Modification
157
+ ```bash
158
+ jarvis-coder --feature "Add new feature" # Modify code to add new feature
159
+ ```
160
+
161
+ ### Codebase Search
143
162
  ```bash
144
- jarvis -f file1.py file2.py # Process specific files
163
+ jarvis-codebase --search "database connection" # Search codebase
164
+ ```
165
+
166
+ ### Codebase Question
167
+ ```bash
168
+ jarvis-codebase --ask "How to use the database?" # Ask about codebase
145
169
  ```
146
170
 
147
171
  ### Keep Chat History
@@ -151,6 +175,7 @@ jarvis --keep-history # Don't delete chat session after completion
151
175
 
152
176
  ## 🛠️ Tools
153
177
 
178
+
154
179
  ### Built-in Tools
155
180
 
156
181
  | Tool | Description |
@@ -160,27 +185,43 @@ jarvis --keep-history # Don't delete chat session after completion
160
185
  | generate_tool | AI-powered tool generation and integration |
161
186
  | methodology | Experience accumulation and methodology management |
162
187
  | create_sub_agent | Create specialized sub-agents for specific tasks |
188
+ | coder | Automatic code modification and generation tool |
189
+ | codebase | Codebase management and search tool |
163
190
 
164
191
  ### Tool Locations
165
192
  - Built-in tools: `src/jarvis/tools/`
166
193
  - User tools: `~/.jarvis_tools/`
167
194
 
195
+
168
196
  ### Key Features
169
197
 
170
198
  #### 1. Self-Extending Capabilities
171
199
  - Tool generation through natural language description
172
200
  - Automatic code generation and integration
173
201
  - Dynamic capability expansion through sub-agents
202
+ - Automatic code modification with version control
203
+ - Codebase indexing and semantic search
174
204
 
175
205
  #### 2. Methodology Learning
176
206
  - Automatic experience accumulation from interactions
177
207
  - Pattern recognition and methodology extraction
178
208
  - Continuous refinement through usage
209
+ - Code modification history tracking
210
+ - Codebase analysis and documentation generation
179
211
 
180
212
  #### 3. Adaptive Problem Solving
181
213
  - Context-aware sub-agent creation
182
214
  - Dynamic tool composition
183
215
  - Learning from execution feedback
216
+ - Codebase-aware problem solving
217
+ - Multi-model collaboration for complex tasks
218
+
219
+ #### 4. Code Intelligence
220
+ - Automatic codebase indexing
221
+ - Semantic code search
222
+ - Code modification with git integration
223
+ - Code analysis and documentation
224
+ - Multi-model code generation
184
225
 
185
226
  ## 🎯 Extending Jarvis
186
227
 
@@ -241,55 +282,57 @@ Create a new Python file in `~/.jarvis_models/`:
241
282
 
242
283
  ```python
243
284
  from typing import Dict, List
244
- from jarvis.models.base import BaseModel
285
+ from jarvis.models.base import BasePlatform
245
286
  from jarvis.utils import PrettyOutput, OutputType
246
287
 
247
- class CustomModel(BaseModel):
288
+ class CustomPlatform(BasePlatform):
248
289
  """Custom model implementation"""
249
290
 
250
- model_name = "custom" # Model identifier
291
+ platform_name = "custom" # Platform identifier
251
292
 
252
293
  def __init__(self):
253
294
  """Initialize model"""
254
- # Add your initialization code here
295
+ # add initialization code
296
+ super().__init__()
255
297
  self.messages = []
256
298
  self.system_message = ""
257
-
258
- def set_system_message(self, message: str):
259
- """Set system message"""
260
- self.system_message = message
261
-
299
+
300
+ def set_model_name(self, model_name: str):
301
+ """Set model name"""
302
+ self.model_name = model_name
303
+
262
304
  def chat(self, message: str) -> str:
263
- """Execute chat with the model
305
+ """Chat with model
264
306
 
265
307
  Args:
266
- message: User input message
308
+ message: user input message
267
309
 
268
310
  Returns:
269
- str: Model response
311
+ str: model response
270
312
  """
271
313
  try:
272
- # Implement chat logic here
273
- PrettyOutput.print("发送请求...", OutputType.PROGRESS)
314
+ # implement chat logic
315
+ PrettyOutput.print("Sending request...", OutputType.PROGRESS)
274
316
 
275
- # Add message to history
317
+ # add message to history
276
318
  self.messages.append({"role": "user", "content": message})
277
319
 
278
- # Get response from your model
279
- response = "Model response"
320
+ # get response from model
321
+ response = "model response"
280
322
 
281
- # Add response to history
323
+ # add response to history
282
324
  self.messages.append({"role": "assistant", "content": response})
283
325
 
284
326
  return response
285
327
 
286
328
  except Exception as e:
287
- PrettyOutput.print(f"对话失败: {str(e)}", OutputType.ERROR)
329
+ PrettyOutput.print(f"Chat failed: {str(e)}", OutputType.ERROR)
288
330
  raise Exception(f"Chat failed: {str(e)}")
289
-
290
- def name(self) -> str:
291
- """Return model name"""
292
- return self.model_name
331
+
332
+ def upload_files(self, file_list: List[str]) -> List[Dict]:
333
+ """Upload files"""
334
+ # implement file upload logic
335
+ return []
293
336
 
294
337
  def reset(self):
295
338
  """Reset model state"""
@@ -297,10 +340,22 @@ class CustomModel(BaseModel):
297
340
  if self.system_message:
298
341
  self.messages.append({"role": "system", "content": self.system_message})
299
342
 
343
+ def name(self) -> str:
344
+ """Return model name"""
345
+ return self.model_name
346
+
300
347
  def delete_chat(self) -> bool:
301
348
  """Delete current chat session"""
302
349
  self.reset()
303
- return True
350
+ return True
351
+
352
+ def set_system_message(self, message: str):
353
+ """Set system message"""
354
+ self.system_message = message
355
+
356
+ def set_suppress_output(self, suppress: bool):
357
+ """Set whether to suppress output"""
358
+ self.suppress_output = suppress
304
359
  ```
305
360
 
306
361
  ### Development Guidelines
@@ -0,0 +1,33 @@
1
+ jarvis/__init__.py,sha256=un8MKMurE4TQ58dJg7nKMX1AVpzjB6SOlLsT0fZsdWI,50
2
+ jarvis/agent.py,sha256=jQAEJ3C8DEcmtCozXCieUcRKhhPSXJe8ylWuI4LSrOk,15032
3
+ jarvis/main.py,sha256=7EcSlxa5JFFXBujzKDWdNtwX6axLhFFdJMc2GxTjfdk,6295
4
+ jarvis/utils.py,sha256=vZV8sHj0ggZy4Rb8RxIujQhRWgeNEomhqVl4WXmpq7c,7498
5
+ jarvis/jarvis_codebase/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
+ jarvis/jarvis_codebase/main.py,sha256=G8ADdTgjZTxEjvP11IBbjHiNWCvuTkFiLkDKq_8UpI0,26947
7
+ jarvis/jarvis_coder/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ jarvis/jarvis_coder/main.py,sha256=4YhQ20MD8ntdD5hjmjJbBHYEDPDZ2aPIgAviJCvtOXE,24458
9
+ jarvis/models/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
10
+ jarvis/models/ai8.py,sha256=vgy-r_3HHxGMAalZrA65VWHC1PuwBTYgtprSgHkCbrk,12557
11
+ jarvis/models/base.py,sha256=ShV1H8Unee4RMaiFO4idROQA0Hc6wu4dyeRPX5fcszk,1433
12
+ jarvis/models/kimi.py,sha256=1iTB0Z_WOmCML3Ufsge6jmeKOYvccr7I5lS3JUXymU4,17611
13
+ jarvis/models/openai.py,sha256=ayaBWAN5VexMcKVrjEPDNB-Q9wx0sCV9Z4BCrvwYJ9w,4315
14
+ jarvis/models/oyi.py,sha256=X2c5SWDIuQDCCFBcEKbzIWEz3I34eOAi0d1XAFgxlpw,15001
15
+ jarvis/models/registry.py,sha256=YpooKSpk5pSWfb5cBDz5wRfPK-abb9uuUZr4WBejqwI,7762
16
+ jarvis/tools/__init__.py,sha256=7Rqyj5hBAv5cWDVr5T9ZTZASO7ssBHeQNm2_4ZARdkA,72
17
+ jarvis/tools/base.py,sha256=EGRGbdfbLXDLwtyoWdvp9rlxNX7bzc20t0Vc2VkwIEY,652
18
+ jarvis/tools/codebase_qa.py,sha256=LsowsgL7HBmdBwa7zXcYi_OkwOok4qbnzYWYsuZxHtU,2413
19
+ jarvis/tools/coder.py,sha256=ZJfPInKms4Hj3-eQlBwamVsvZ-2nlZ-4jsqJ-tJc6mg,2040
20
+ jarvis/tools/file_ops.py,sha256=h8g0eT9UvlJf4kt0DLXvdSsjcPj7x19lxWdDApeDfpg,3842
21
+ jarvis/tools/generator.py,sha256=vVP3eN5cCDpRXf_fn0skETkPXAW1XZFWx9pt2_ahK48,5999
22
+ jarvis/tools/methodology.py,sha256=UG6s5VYRcd9wrKX4cg6f7zJhet5AIcthFGMOAdevBiw,5175
23
+ jarvis/tools/registry.py,sha256=MeTYNdZNRdhlgABviVxzbDPSgLpwDp2Nx2dGzedRu8U,7212
24
+ jarvis/tools/search.py,sha256=1EqOVvLhg2Csh-i03-XeCrusbyfmH69FZ8khwZt8Tow,6131
25
+ jarvis/tools/shell.py,sha256=UPKshPyOaUwTngresUw-ot1jHjQIb4wCY5nkJqa38lU,2520
26
+ jarvis/tools/sub_agent.py,sha256=rEtAmSVY2ZjFOZEKr5m5wpACOQIiM9Zr_3dT92FhXYU,2621
27
+ jarvis/tools/webpage.py,sha256=d3w3Jcjcu1ESciezTkz3n3Zf-rp_l91PrVoDEZnckOo,2391
28
+ jarvis_ai_assistant-0.1.74.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
29
+ jarvis_ai_assistant-0.1.74.dist-info/METADATA,sha256=ajh1yMCWevAgppfPVYQxcKV4J143iOBz1SyBC9KGd9o,12399
30
+ jarvis_ai_assistant-0.1.74.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
31
+ jarvis_ai_assistant-0.1.74.dist-info/entry_points.txt,sha256=QNUeqmUJd7nHufel2FO7cRttS1uKFfnbIyObv8eVyOY,140
32
+ jarvis_ai_assistant-0.1.74.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
33
+ jarvis_ai_assistant-0.1.74.dist-info/RECORD,,
@@ -1,3 +1,4 @@
1
1
  [console_scripts]
2
2
  jarvis = jarvis.main:main
3
+ jarvis-codebase = jarvis.jarvis_codebase.main:main
3
4
  jarvis-coder = jarvis.jarvis_coder.main:main
@@ -1,38 +0,0 @@
1
- from playwright.sync_api import sync_playwright
2
- from urllib.parse import quote
3
-
4
- def bing_search(query):
5
- try:
6
- with sync_playwright() as p:
7
- browser = p.chromium.launch()
8
- page = browser.new_page()
9
- page.goto(
10
- f"https://www.bing.com/search?form=QBRE&q={quote(query)}&cc=US"
11
- )
12
-
13
- page.wait_for_selector("#b_results", timeout=10000)
14
-
15
- summaries = page.evaluate("""() => {
16
- const liElements = Array.from(
17
- document.querySelectorAll("#b_results > .b_algo")
18
- );
19
- return liElements.map((li) => {
20
- const abstractElement = li.querySelector(".b_caption > p");
21
- const linkElement = li.querySelector("a");
22
- const href = linkElement.getAttribute("href");
23
- const title = linkElement.textContent;
24
- const abstract = abstractElement ? abstractElement.textContent : "";
25
- return { href, title, abstract };
26
- });
27
- }""")
28
-
29
- browser.close()
30
- print(summaries)
31
- return summaries
32
- except Exception as error:
33
- print("An error occurred:", error)
34
-
35
- if __name__ == "__main__":
36
- # results = bing_search("北京到西雅图的距离")
37
- results = bing_search("北京到西雅图的距离")
38
- print(results)
@@ -1,29 +0,0 @@
1
- jarvis/__init__.py,sha256=rc0PX9hG--lb8NGfVN3-VdS1SnQTkK_G_FvWr1ZO-LM,50
2
- jarvis/agent.py,sha256=s8VebNef8BbKM6D9IDWWN-XenEXEL9KoYnDLGKyZY58,12347
3
- jarvis/main.py,sha256=gXXtnrkkvGwEswJL6qiYjVrg3bpzye-GJeAe0Nf2B9o,6509
4
- jarvis/utils.py,sha256=JlkuC9RtspXH2VWDmj9nR0vnb8ie1gIsKc4vC7WRco8,7321
5
- jarvis/jarvis_coder/main.py,sha256=7Zc50dpPSM6hq4ASg1-yGZ83iS1NxuvQn70D9SPNbqY,30751
6
- jarvis/models/__init__.py,sha256=mrOt67nselz_H1gX9wdAO4y2DY5WPXzABqJbr5Des8k,63
7
- jarvis/models/ai8.py,sha256=aSiUazBrj4Fsit3tQX7jj8nM8MDBhHFnFrbQC6CvcGw,12745
8
- jarvis/models/base.py,sha256=39g0GcXrNu16RV3HzazIqleynCaQDhm0XzF0r0uMDro,1506
9
- jarvis/models/kimi.py,sha256=j4VtRip0WhTgI4PGL_YXL9Z-II-xHe6hvJW3vOY-ShA,17545
10
- jarvis/models/openai.py,sha256=FcZVcCK41jP4SB_q4kZ6bga2tYbL-s6zjpS4KU30-tw,4477
11
- jarvis/models/oyi.py,sha256=vVs1ru5K8WpofjwoYTxUQVvXL4Yc7ZH6nZhKYpEZcdk,15288
12
- jarvis/models/registry.py,sha256=iVBjN9ImEvGHcz8WR-z8pPMJQZI907o_nccVOFANhak,7951
13
- jarvis/tools/__init__.py,sha256=Kj1bKj34lwRDKMKHLOrLyQElf2lHbqA2tDgP359eaDo,71
14
- jarvis/tools/base.py,sha256=EGRGbdfbLXDLwtyoWdvp9rlxNX7bzc20t0Vc2VkwIEY,652
15
- jarvis/tools/bing_search.py,sha256=SvYeXM83eP9qREDcWguh0_r0m0npbcwXIyzEwwfreKU,1444
16
- jarvis/tools/file_ops.py,sha256=h8g0eT9UvlJf4kt0DLXvdSsjcPj7x19lxWdDApeDfpg,3842
17
- jarvis/tools/generator.py,sha256=vVP3eN5cCDpRXf_fn0skETkPXAW1XZFWx9pt2_ahK48,5999
18
- jarvis/tools/methodology.py,sha256=G3cOaHTMujGZBhDLhQEqyCV2NISizO3MXRuho1KfI6Y,5223
19
- jarvis/tools/registry.py,sha256=mlOAmUq3yzRz-7yvwrrCwbe5Lmw8eh1v8-_Fa5sezwI,7209
20
- jarvis/tools/search.py,sha256=o7EJqEtKKDqlENkXhxDuDA73djzeEH9j4BB0n61egso,4899
21
- jarvis/tools/shell.py,sha256=UPKshPyOaUwTngresUw-ot1jHjQIb4wCY5nkJqa38lU,2520
22
- jarvis/tools/sub_agent.py,sha256=rEtAmSVY2ZjFOZEKr5m5wpACOQIiM9Zr_3dT92FhXYU,2621
23
- jarvis/tools/webpage.py,sha256=d3w3Jcjcu1ESciezTkz3n3Zf-rp_l91PrVoDEZnckOo,2391
24
- jarvis_ai_assistant-0.1.58.dist-info/LICENSE,sha256=AGgVgQmTqFvaztRtCAXsAMryUymB18gZif7_l2e1XOg,1063
25
- jarvis_ai_assistant-0.1.58.dist-info/METADATA,sha256=upXDcw_I_71ZInBR5zWI90zGsm5YDBoFG64btCGews0,10049
26
- jarvis_ai_assistant-0.1.58.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
27
- jarvis_ai_assistant-0.1.58.dist-info/entry_points.txt,sha256=ieRI4ilnGNx1R6LlzT2P510mJ27lhLesVZToezDjSd8,89
28
- jarvis_ai_assistant-0.1.58.dist-info/top_level.txt,sha256=1BOxyWfzOP_ZXj8rVTDnNCJ92bBGB0rwq8N1PCpoMIs,7
29
- jarvis_ai_assistant-0.1.58.dist-info/RECORD,,