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

jarvis/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  """Jarvis AI Assistant"""
2
2
 
3
- __version__ = "0.1.129"
3
+ __version__ = "0.1.130"
@@ -23,10 +23,10 @@ import os
23
23
  class Agent:
24
24
 
25
25
  def set_summary_prompt(self, summary_prompt: str):
26
- """Set the summary prompt for task completion.
26
+ """设置任务完成时的总结提示模板。
27
27
 
28
- Args:
29
- summary_prompt: The prompt template for generating task summaries
28
+ 参数:
29
+ summary_prompt: 用于生成任务总结的提示模板
30
30
  """
31
31
  self.summary_prompt = summary_prompt
32
32
 
@@ -152,23 +152,23 @@ class Agent:
152
152
 
153
153
 
154
154
 
155
- def _call_model(self, message: str) -> str:
156
- """Call the AI model with retry logic.
155
+ def _call_model(self, message: str) -> str:
156
+ """调用AI模型并实现重试逻辑。
157
157
 
158
- Args:
159
- message: The input message for the model
158
+ 参数:
159
+ message: 输入给模型的消息
160
160
 
161
- Returns:
162
- str: Model's response
161
+ 返回:
162
+ str: 模型的响应
163
163
 
164
- Note:
165
- Will retry with exponential backoff up to 30 seconds between retries
164
+ 注意:
165
+ 将使用指数退避重试,最多重试30
166
166
  """
167
167
  for handler in self.input_handler:
168
168
  message, need_return = handler(message, self)
169
169
  if need_return:
170
170
  return message
171
- PrettyOutput.section("模型输出", OutputType.SYSTEM)
171
+ print("🤖 模型思考:")
172
172
  return self.model.chat_until_success(message) # type: ignore
173
173
 
174
174
 
@@ -352,16 +352,16 @@ class Agent:
352
352
  return f"Task failed: {str(e)}"
353
353
 
354
354
  def _clear_history(self):
355
- """Clear conversation history while preserving system prompt.
355
+ """清空对话历史但保留系统提示。
356
356
 
357
- This will:
358
- 1. Clear the prompt
359
- 2. Reset the model
360
- 3. Reset conversation length counter
357
+ 该方法将:
358
+ 1. 清空当前提示
359
+ 2. 重置模型状态
360
+ 3. 重置对话长度计数器
361
361
  """
362
362
  self.prompt = ""
363
363
  self.model.reset() # type: ignore
364
- self.conversation_length = 0 # Reset conversation length
364
+ self.conversation_length = 0 # 重置对话长度
365
365
 
366
366
 
367
367