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

Files changed (41) hide show
  1. jarvis/__init__.py +1 -1
  2. jarvis/agent.py +138 -144
  3. jarvis/jarvis_codebase/main.py +87 -54
  4. jarvis/jarvis_coder/git_utils.py +4 -7
  5. jarvis/jarvis_coder/main.py +17 -22
  6. jarvis/jarvis_coder/patch_handler.py +141 -442
  7. jarvis/jarvis_coder/plan_generator.py +64 -36
  8. jarvis/jarvis_platform/main.py +1 -1
  9. jarvis/jarvis_rag/main.py +1 -1
  10. jarvis/jarvis_smart_shell/main.py +15 -15
  11. jarvis/main.py +24 -24
  12. jarvis/models/ai8.py +22 -22
  13. jarvis/models/base.py +17 -13
  14. jarvis/models/kimi.py +31 -31
  15. jarvis/models/ollama.py +28 -28
  16. jarvis/models/openai.py +22 -24
  17. jarvis/models/oyi.py +25 -25
  18. jarvis/models/registry.py +33 -34
  19. jarvis/tools/ask_user.py +5 -5
  20. jarvis/tools/base.py +2 -2
  21. jarvis/tools/chdir.py +9 -9
  22. jarvis/tools/codebase_qa.py +4 -4
  23. jarvis/tools/coder.py +4 -4
  24. jarvis/tools/file_ops.py +1 -1
  25. jarvis/tools/generator.py +23 -23
  26. jarvis/tools/methodology.py +4 -4
  27. jarvis/tools/rag.py +4 -4
  28. jarvis/tools/registry.py +38 -38
  29. jarvis/tools/search.py +42 -42
  30. jarvis/tools/shell.py +13 -13
  31. jarvis/tools/sub_agent.py +16 -16
  32. jarvis/tools/thinker.py +41 -41
  33. jarvis/tools/webpage.py +17 -17
  34. jarvis/utils.py +59 -60
  35. {jarvis_ai_assistant-0.1.93.dist-info → jarvis_ai_assistant-0.1.97.dist-info}/METADATA +1 -1
  36. jarvis_ai_assistant-0.1.97.dist-info/RECORD +47 -0
  37. jarvis_ai_assistant-0.1.93.dist-info/RECORD +0 -47
  38. {jarvis_ai_assistant-0.1.93.dist-info → jarvis_ai_assistant-0.1.97.dist-info}/LICENSE +0 -0
  39. {jarvis_ai_assistant-0.1.93.dist-info → jarvis_ai_assistant-0.1.97.dist-info}/WHEEL +0 -0
  40. {jarvis_ai_assistant-0.1.93.dist-info → jarvis_ai_assistant-0.1.97.dist-info}/entry_points.txt +0 -0
  41. {jarvis_ai_assistant-0.1.93.dist-info → jarvis_ai_assistant-0.1.97.dist-info}/top_level.txt +0 -0
jarvis/models/registry.py CHANGED
@@ -19,7 +19,7 @@ REQUIRED_METHODS = [
19
19
  ]
20
20
 
21
21
  class PlatformRegistry:
22
- """平台注册器"""
22
+ """Platform registry"""
23
23
 
24
24
  global_platform_name = "kimi"
25
25
  global_platform_registry = None
@@ -37,19 +37,19 @@ class PlatformRegistry:
37
37
 
38
38
  pass
39
39
  except Exception as e:
40
- PrettyOutput.print(f"创建平台目录失败: {str(e)}", OutputType.ERROR)
40
+ PrettyOutput.print(f"Create platform directory failed: {str(e)}", OutputType.ERROR)
41
41
  return ""
42
42
  return user_platform_dir
43
43
 
44
44
  @staticmethod
45
45
  def check_platform_implementation(platform_class: Type[BasePlatform]) -> bool:
46
- """检查平台类是否实现了所有必要的方法
46
+ """Check if the platform class implements all necessary methods
47
47
 
48
48
  Args:
49
- platform_class: 要检查的平台类
49
+ platform_class: The platform class to check
50
50
 
51
51
  Returns:
52
- bool: 是否实现了所有必要的方法
52
+ bool: Whether all necessary methods are implemented
53
53
  """
54
54
  missing_methods = []
55
55
 
@@ -68,11 +68,11 @@ class PlatformRegistry:
68
68
  sig = inspect.signature(method)
69
69
  method_params = [p for p in sig.parameters if p != 'self']
70
70
  if len(method_params) != len(params):
71
- missing_methods.append(f"{method_name}(参数不匹配)")
71
+ missing_methods.append(f"{method_name}(parameter mismatch)")
72
72
 
73
73
  if missing_methods:
74
74
  PrettyOutput.print(
75
- f"平台 {platform_class.__name__} 缺少必要的方法: {', '.join(missing_methods)}",
75
+ f"Platform {platform_class.__name__} is missing necessary methods: {', '.join(missing_methods)}",
76
76
  OutputType.ERROR
77
77
  )
78
78
  return False
@@ -81,19 +81,19 @@ class PlatformRegistry:
81
81
 
82
82
  @staticmethod
83
83
  def load_platform_from_dir(directory: str) -> Dict[str, Type[BasePlatform]]:
84
- """从指定目录加载平台
84
+ """Load platforms from specified directory
85
85
 
86
86
  Args:
87
- directory: 平台目录路径
87
+ directory: Platform directory path
88
88
 
89
89
  Returns:
90
- Dict[str, Type[BasePlatform]]: 平台名称到平台类的映射
90
+ Dict[str, Type[BasePlatform]]: Platform name to platform class mapping
91
91
  """
92
92
  platforms = {}
93
93
 
94
94
  # 确保目录存在
95
95
  if not os.path.exists(directory):
96
- PrettyOutput.print(f"平台目录不存在: {directory}", OutputType.ERROR)
96
+ PrettyOutput.print(f"Platform directory does not exist: {directory}", OutputType.ERROR)
97
97
  return platforms
98
98
 
99
99
  # 获取目录的包名
@@ -127,18 +127,18 @@ class PlatformRegistry:
127
127
  if not PlatformRegistry.check_platform_implementation(obj):
128
128
  continue
129
129
  if not PlatformRegistry.suppress_output:
130
- PrettyOutput.print(f" {os.path.join(directory, filename)} 加载平台:{obj.platform_name}", OutputType.SUCCESS)
131
- platforms[obj.platform_name] = obj
130
+ PrettyOutput.print(f"Load platform from {os.path.join(directory, filename)}: {obj.platform_name}", OutputType.SUCCESS) # type: ignore
131
+ platforms[obj.platform_name] = obj # type: ignore
132
132
  break
133
133
  except Exception as e:
134
- PrettyOutput.print(f"加载平台 {module_name} 失败: {str(e)}", OutputType.ERROR)
134
+ PrettyOutput.print(f"Load platform {module_name} failed: {str(e)}", OutputType.ERROR)
135
135
 
136
136
  return platforms
137
137
 
138
138
 
139
139
  @staticmethod
140
140
  def get_global_platform_registry():
141
- """获取全局平台注册器"""
141
+ """Get global platform registry"""
142
142
  if PlatformRegistry.global_platform_registry is None:
143
143
  PlatformRegistry.global_platform_registry = PlatformRegistry()
144
144
 
@@ -154,58 +154,57 @@ class PlatformRegistry:
154
154
  return PlatformRegistry.global_platform_registry
155
155
 
156
156
  def __init__(self):
157
- """初始化平台注册器
158
- """
157
+ """Initialize platform registry"""
159
158
  self.platforms: Dict[str, Type[BasePlatform]] = {}
160
159
 
161
160
  def get_normal_platform(self) -> BasePlatform:
162
161
  platform_name = os.environ.get("JARVIS_PLATFORM", "kimi")
163
162
  model_name = os.environ.get("JARVIS_MODEL", "kimi")
164
163
  platform = self.create_platform(platform_name)
165
- platform.set_model_name(model_name)
166
- return platform
164
+ platform.set_model_name(model_name) # type: ignore
165
+ return platform # type: ignore
167
166
 
168
167
  def get_codegen_platform(self) -> BasePlatform:
169
168
  platform_name = os.environ.get("JARVIS_CODEGEN_PLATFORM", os.environ.get("JARVIS_PLATFORM", "kimi"))
170
169
  model_name = os.environ.get("JARVIS_CODEGEN_MODEL", os.environ.get("JARVIS_MODEL", "kimi"))
171
170
  platform = self.create_platform(platform_name)
172
- platform.set_model_name(model_name)
173
- return platform
171
+ platform.set_model_name(model_name) # type: ignore
172
+ return platform # type: ignore
174
173
 
175
174
  def get_cheap_platform(self) -> BasePlatform:
176
175
  platform_name = os.environ.get("JARVIS_CHEAP_PLATFORM", os.environ.get("JARVIS_PLATFORM", "kimi"))
177
176
  model_name = os.environ.get("JARVIS_CHEAP_MODEL", os.environ.get("JARVIS_MODEL", "kimi"))
178
177
  platform = self.create_platform(platform_name)
179
- platform.set_model_name(model_name)
180
- return platform
178
+ platform.set_model_name(model_name) # type: ignore
179
+ return platform # type: ignore
181
180
 
182
181
  def get_thinking_platform(self) -> BasePlatform:
183
182
  platform_name = os.environ.get("JARVIS_THINKING_PLATFORM", os.environ.get("JARVIS_PLATFORM", "kimi"))
184
183
  model_name = os.environ.get("JARVIS_THINKING_MODEL", os.environ.get("JARVIS_MODEL", "kimi"))
185
184
  platform = self.create_platform(platform_name)
186
- platform.set_model_name(model_name)
187
- return platform
185
+ platform.set_model_name(model_name) # type: ignore
186
+ return platform # type: ignore
188
187
 
189
188
  def register_platform(self, name: str, platform_class: Type[BasePlatform]):
190
- """注册平台类
189
+ """Register platform class
191
190
 
192
191
  Args:
193
- name: 平台名称
194
- model_class: 平台类
192
+ name: Platform name
193
+ model_class: Platform class
195
194
  """
196
195
  self.platforms[name] = platform_class
197
196
 
198
197
  def create_platform(self, name: str) -> Optional[BasePlatform]:
199
- """创建平台实例
198
+ """Create platform instance
200
199
 
201
200
  Args:
202
- name: 平台名称
201
+ name: Platform name
203
202
 
204
203
  Returns:
205
- BasePlatform: 平台实例
204
+ BasePlatform: Platform instance
206
205
  """
207
206
  if name not in self.platforms:
208
- PrettyOutput.print(f"未找到平台: {name}", OutputType.ERROR)
207
+ PrettyOutput.print(f"Platform not found: {name}", OutputType.ERROR)
209
208
  return None
210
209
 
211
210
  try:
@@ -213,10 +212,10 @@ class PlatformRegistry:
213
212
  platform = self.platforms[name]()
214
213
  return platform
215
214
  except Exception as e:
216
- PrettyOutput.print(f"创建平台失败: {str(e)}", OutputType.ERROR)
215
+ PrettyOutput.print(f"Create platform failed: {str(e)}", OutputType.ERROR)
217
216
  return None
218
217
 
219
218
  def get_available_platforms(self) -> List[str]:
220
- """获取可用平台列表"""
219
+ """Get available platform list"""
221
220
  return list(self.platforms.keys())
222
221
 
jarvis/tools/ask_user.py CHANGED
@@ -4,13 +4,13 @@ from jarvis.utils import get_multiline_input, PrettyOutput, OutputType
4
4
 
5
5
  class AskUserTool:
6
6
  name="ask_user"
7
- description="""当缺少完成任务的信息或有关键决策信息缺失时,询问用户。用户可以输入多行文本,空行结束输入。使用场景:1. 需要用户提供更多信息来完成任务;2. 需要用户做出关键决策;3. 需要用户确认某些重要操作;4. 需要用户提供额外信息"""
7
+ description="""Ask the user when information needed to complete the task is missing or when critical decision information is lacking. Users can input multiple lines of text, ending with an empty line. Use cases: 1. Need user to provide more information to complete the task; 2. Need user to make critical decisions; 3. Need user to confirm important operations; 4. Need user to provide additional information"""
8
8
  parameters={
9
9
  "type": "object",
10
10
  "properties": {
11
11
  "question": {
12
12
  "type": "string",
13
- "description": "要询问用户的问题"
13
+ "description": "The question to ask the user"
14
14
  }
15
15
  },
16
16
  "required": ["question"]
@@ -34,12 +34,12 @@ class AskUserTool:
34
34
  PrettyOutput.print(question, OutputType.SYSTEM)
35
35
 
36
36
  # 获取用户输入
37
- user_response = get_multiline_input("请输入您的回答(输入空行结束)")
37
+ user_response = get_multiline_input("Please enter your answer (input empty line to end)")
38
38
 
39
39
  if user_response == "__interrupt__":
40
40
  return {
41
41
  "success": False,
42
- "error": "用户取消了输入"
42
+ "error": "User canceled input"
43
43
  }
44
44
 
45
45
  return {
@@ -50,5 +50,5 @@ class AskUserTool:
50
50
  except Exception as e:
51
51
  return {
52
52
  "success": False,
53
- "error": f"询问用户失败: {str(e)}"
53
+ "error": f"Failed to ask user: {str(e)}"
54
54
  }
jarvis/tools/base.py CHANGED
@@ -11,7 +11,7 @@ class Tool:
11
11
  self.func = func
12
12
 
13
13
  def to_dict(self) -> Dict:
14
- """转换为工具格式"""
14
+ """Convert to tool format"""
15
15
  return {
16
16
  "name": self.name,
17
17
  "description": self.description,
@@ -19,5 +19,5 @@ class Tool:
19
19
  }
20
20
 
21
21
  def execute(self, arguments: Dict) -> Dict[str, Any]:
22
- """执行工具函数"""
22
+ """Execute tool function"""
23
23
  return self.func(arguments)
jarvis/tools/chdir.py CHANGED
@@ -6,13 +6,13 @@ class ChdirTool:
6
6
  """修改当前工作目录的工具"""
7
7
 
8
8
  name = "chdir"
9
- description = "修改当前工作目录"
9
+ description = "Change current working directory"
10
10
  parameters = {
11
11
  "type": "object",
12
12
  "properties": {
13
13
  "path": {
14
14
  "type": "string",
15
- "description": "要切换到的目录路径,支持相对路径和绝对路径"
15
+ "description": "Directory path to switch to, supports both relative and absolute paths"
16
16
  }
17
17
  },
18
18
  "required": ["path"]
@@ -38,14 +38,14 @@ class ChdirTool:
38
38
  if not os.path.exists(path):
39
39
  return {
40
40
  "success": False,
41
- "error": f"目录不存在: {path}"
41
+ "error": f"Directory does not exist: {path}"
42
42
  }
43
43
 
44
44
  # 检查是否是目录
45
45
  if not os.path.isdir(path):
46
46
  return {
47
47
  "success": False,
48
- "error": f"路径不是目录: {path}"
48
+ "error": f"The path is not a directory: {path}"
49
49
  }
50
50
 
51
51
  # 尝试切换目录
@@ -54,27 +54,27 @@ class ChdirTool:
54
54
 
55
55
  return {
56
56
  "success": True,
57
- "stdout": f"已切换工作目录:\n从: {old_path}\n到: {path}",
57
+ "stdout": f"Changed working directory:\nFrom: {old_path}\nTo: {path}",
58
58
  "stderr": ""
59
59
  }
60
60
 
61
61
  except PermissionError:
62
62
  return {
63
63
  "success": False,
64
- "error": f"没有权限访问目录: {path}"
64
+ "error": f"No permission to access directory: {path}"
65
65
  }
66
66
  except Exception as e:
67
67
  return {
68
68
  "success": False,
69
- "error": f"切换目录失败: {str(e)}"
69
+ "error": f"Failed to switch directory: {str(e)}"
70
70
  }
71
71
 
72
72
  def main():
73
73
  """命令行直接运行工具"""
74
74
  import argparse
75
75
 
76
- parser = argparse.ArgumentParser(description='修改当前工作目录')
77
- parser.add_argument('path', help='要切换到的目录路径')
76
+ parser = argparse.ArgumentParser(description='Change current working directory')
77
+ parser.add_argument('path', help='Directory path to switch to, supports both relative and absolute paths')
78
78
  args = parser.parse_args()
79
79
 
80
80
  tool = ChdirTool()
@@ -7,21 +7,21 @@ class CodebaseQATool:
7
7
  """代码库问答工具,用于回答关于代码库的问题"""
8
8
 
9
9
  name = "codebase_qa"
10
- description = "回答关于代码库的问题,可以查询和理解代码的功能、结构和实现细节"
10
+ description = "Answer questions about the codebase, can query and understand code functionality, structure, and implementation details"
11
11
  parameters = {
12
12
  "type": "object",
13
13
  "properties": {
14
14
  "dir": {
15
15
  "type": "string",
16
- "description": "项目根目录"
16
+ "description": "Project root directory"
17
17
  },
18
18
  "question": {
19
19
  "type": "string",
20
- "description": "关于代码库的问题"
20
+ "description": "Question about the codebase"
21
21
  },
22
22
  "top_k": {
23
23
  "type": "integer",
24
- "description": "搜索相关文件的数量",
24
+ "description": "Number of relevant files to search",
25
25
  "default": 5
26
26
  }
27
27
  },
jarvis/tools/coder.py CHANGED
@@ -7,21 +7,21 @@ class CoderTool:
7
7
  """代码修改工具"""
8
8
 
9
9
  name = "coder"
10
- description = "分析并修改现有代码,用于实现新功能、修复bug、重构代码等。能理解代码上下文并进行精确的代码编辑。"
10
+ description = "Analyze and modify existing code for implementing new features, fixing bugs, refactoring code, etc. Can understand code context and perform precise code edits."
11
11
  parameters = {
12
12
  "feature": {
13
13
  "type": "string",
14
- "description": "要实现的功能描述或需要修改的内容,例如:'添加日志功能''修复内存泄漏''优化性能'",
14
+ "description": "Description of the feature to implement or content to modify, e.g., 'add logging functionality', 'fix memory leak', 'optimize performance', etc.",
15
15
  "required": True
16
16
  },
17
17
  "dir": {
18
18
  "type": "string",
19
- "description": "项目根目录,默认为当前目录",
19
+ "description": "Project root directory, defaults to current directory",
20
20
  "required": False
21
21
  },
22
22
  "language": {
23
23
  "type": "string",
24
- "description": "项目的主要编程语言,默认为python",
24
+ "description": "Main programming language of the project, defaults to python",
25
25
  "required": False
26
26
  }
27
27
  }
jarvis/tools/file_ops.py CHANGED
@@ -7,7 +7,7 @@ from jarvis.utils import OutputType, PrettyOutput
7
7
 
8
8
  class FileOperationTool:
9
9
  name = "file_operation"
10
- description = "文件操作 (read/write/append/exists)"
10
+ description = "File operations (read/write/append/exists)"
11
11
  parameters = {
12
12
  "type": "object",
13
13
  "properties": {
jarvis/tools/generator.py CHANGED
@@ -7,25 +7,25 @@ from jarvis.utils import OutputType, PrettyOutput
7
7
 
8
8
  class ToolGeneratorTool:
9
9
  name = "generate_tool"
10
- description = "生成新的工具代码并自动注册到Jarvis,自动扩充Jarvis的能力"
10
+ description = "Generate new tool code and automatically register it to Jarvis, automatically expanding Jarvis's capabilities"
11
11
  parameters = {
12
12
  "type": "object",
13
13
  "properties": {
14
14
  "tool_name": {
15
15
  "type": "string",
16
- "description": "工具的名称(snake_case格式)"
16
+ "description": "Name of the tool (in snake_case format)"
17
17
  },
18
18
  "class_name": {
19
19
  "type": "string",
20
- "description": "工具类的名称(PascalCase格式)"
20
+ "description": "Name of the tool class (in PascalCase format)"
21
21
  },
22
22
  "description": {
23
23
  "type": "string",
24
- "description": "工具的功能描述"
24
+ "description": "Description of the tool's functionality"
25
25
  },
26
26
  "parameters": {
27
27
  "type": "object",
28
- "description": "工具参数的JSON Schema定义"
28
+ "description": "JSON Schema definition of tool parameters"
29
29
  }
30
30
  },
31
31
  "required": ["tool_name", "class_name", "description", "parameters"]
@@ -44,14 +44,14 @@ class ToolGeneratorTool:
44
44
  """使用大模型生成工具代码"""
45
45
  model = PlatformRegistry.get_global_platform_registry().get_codegen_platform()
46
46
 
47
- prompt = f"""请生成一个Python工具类的代码,要求如下,除了代码,不要输出任何内容:
47
+ prompt = f"""Please generate the code for a Python tool class, with the following requirements, and do not output any content except the code:
48
48
 
49
- 1. 类名: {class_name}
50
- 2. 工具名称: {tool_name}
51
- 3. 功能描述: {description}
52
- 4. 参数定义: {parameters}
49
+ 1. Class name: {class_name}
50
+ 2. Tool name: {tool_name}
51
+ 3. Function description: {description}
52
+ 4. Parameter definition: {parameters}
53
53
 
54
- 严格按照以下格式生成代码(各函数的参数和返回值一定要与示例一致)
54
+ Strictly follow the following format to generate code (the parameters and return values of each function must be consistent with the example):
55
55
 
56
56
  ```python
57
57
  from typing import Dict, Any, Protocol, Optional
@@ -60,7 +60,7 @@ from jarvis.models.registry import ModelRegistry
60
60
 
61
61
  class ExampleTool:
62
62
  name = "example_tool"
63
- description = "示例工具"
63
+ description = "Example tool"
64
64
  parameters = {{
65
65
  "type": "object",
66
66
  "properties": {{
@@ -70,22 +70,22 @@ class ExampleTool:
70
70
  }}
71
71
 
72
72
  def __init__(self):
73
- self.model = ModelRegistry.get_global_model()
73
+ self.model = ModelRegistry.get_global_platform_registry().get_normal_platform()
74
74
 
75
75
  def execute(self, args: Dict) -> Dict[str, Any]:
76
76
  try:
77
- # 验证参数示例
77
+ # Validate parameter example
78
78
  if "param1" not in args:
79
- return {{"success": False, "error": "缺少必需参数: param1"}}
79
+ return {{"success": False, "error": "Missing required parameter: param1"}}
80
80
 
81
- # 记录操作示例
82
- PrettyOutput.print(f"处理参数: {{args['param1']}}", OutputType.INFO)
81
+ # Record operation example
82
+ PrettyOutput.print(f"Processing parameter: {{args['param1']}}", OutputType.INFO)
83
83
 
84
- # 使用大模型示例
85
- response = self.model.chat("prompt")
84
+ # Use large model example
85
+ response = self.model.chat_until_success("prompt")
86
86
 
87
- # 实现具体功能
88
- result = "处理结果"
87
+ # Implement specific functionality
88
+ result = "Processing result"
89
89
 
90
90
  return {{
91
91
  "success": True,
@@ -101,7 +101,7 @@ class ExampleTool:
101
101
  ```"""
102
102
 
103
103
  # 调用模型生成代码
104
- response = model.chat(prompt)
104
+ response = model.chat_until_success(prompt)
105
105
 
106
106
  # 提取代码块
107
107
  code_start = response.find("```python")
@@ -147,7 +147,7 @@ class ExampleTool:
147
147
  f.write("# Jarvis Tools\n")
148
148
 
149
149
  # 注册工具
150
- success = ToolRegistry.get_global_tool_registry().register_tool_by_file(tool_file)
150
+ success = ToolRegistry.get_global_tool_registry().register_tool_by_file(str(tool_file))
151
151
  if not success:
152
152
  return {
153
153
  "success": False,
@@ -8,22 +8,22 @@ class MethodologyTool:
8
8
  """经验管理工具"""
9
9
 
10
10
  name = "methodology"
11
- description = "管理问题处理方法论,支持添加、更新、删除操作"
11
+ description = "Manage problem-solving methodologies, supporting add, update, and delete operations"
12
12
  parameters = {
13
13
  "type": "object",
14
14
  "properties": {
15
15
  "operation": {
16
16
  "type": "string",
17
- "description": "操作类型 (delete/update/add)",
17
+ "description": "Operation type (delete/update/add)",
18
18
  "enum": ["delete", "update", "add"]
19
19
  },
20
20
  "problem_type": {
21
21
  "type": "string",
22
- "description": "问题类型,例如:code_review, bug_fix "
22
+ "description": "Problem type, e.g., code_review, bug_fix, etc."
23
23
  },
24
24
  "content": {
25
25
  "type": "string",
26
- "description": "方法论内容 (update/add 时必需)",
26
+ "description": "Methodology content (required for update/add)",
27
27
  "optional": True
28
28
  }
29
29
  },
jarvis/tools/rag.py CHANGED
@@ -5,21 +5,21 @@ from jarvis.jarvis_rag.main import RAGTool as RAGCore
5
5
 
6
6
  class RAGTool:
7
7
  name = "rag"
8
- description = "基于文档目录进行问答,支持多种文档格式(txtpdfdocx等)"
8
+ description = "Ask questions based on a document directory, supporting multiple document formats (txt, pdf, docx, etc.)"
9
9
  parameters = {
10
10
  "type": "object",
11
11
  "properties": {
12
12
  "dir": {
13
13
  "type": "string",
14
- "description": "文档目录路径,支持相对路径和绝对路径"
14
+ "description": "Document directory path, supports both relative and absolute paths"
15
15
  },
16
16
  "question": {
17
17
  "type": "string",
18
- "description": "要询问的问题"
18
+ "description": "The question to ask"
19
19
  },
20
20
  "rebuild_index": {
21
21
  "type": "boolean",
22
- "description": "是否重建索引",
22
+ "description": "Whether to rebuild the index",
23
23
  "default": False
24
24
  }
25
25
  },