docs: add changelog entry for version 1.44.0 with progress indicator features
This commit is contained in:
@@ -19,8 +19,8 @@ def run_autonomous_mode(assistant, task):
|
||||
logger.debug(f"Task: {task}")
|
||||
from rp.core.knowledge_context import inject_knowledge_context
|
||||
|
||||
inject_knowledge_context(assistant, task)
|
||||
assistant.messages.append({"role": "user", "content": f"{task}"})
|
||||
inject_knowledge_context(assistant, assistant.messages[-1]["content"])
|
||||
try:
|
||||
while True:
|
||||
assistant.autonomous_iterations += 1
|
||||
|
||||
+21
-12
@@ -6,7 +6,9 @@ import readline
|
||||
import signal
|
||||
import sqlite3
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import uuid
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
from rp.commands import handle_command
|
||||
@@ -109,9 +111,10 @@ class Assistant:
|
||||
self.background_tasks = set()
|
||||
self.last_result = None
|
||||
self.init_database()
|
||||
from rp.memory import KnowledgeStore, FactExtractor
|
||||
from rp.memory import KnowledgeStore, FactExtractor, GraphMemory
|
||||
self.knowledge_store = KnowledgeStore(DB_PATH, db_conn=self.db_conn)
|
||||
self.fact_extractor = FactExtractor()
|
||||
self.graph_memory = GraphMemory(DB_PATH, db_conn=self.db_conn)
|
||||
self.messages.append(init_system_message(args))
|
||||
try:
|
||||
from rp.core.enhanced_assistant import EnhancedAssistant
|
||||
@@ -324,6 +327,8 @@ class Assistant:
|
||||
)
|
||||
return self.process_response(follow_up)
|
||||
content = message.get("content", "")
|
||||
with ProgressIndicator("Updating memory..."):
|
||||
self.graph_memory.populate_from_text(content)
|
||||
return render_markdown(content, self.syntax_highlighting)
|
||||
|
||||
def signal_handler(self, signum, frame):
|
||||
@@ -412,16 +417,18 @@ class Assistant:
|
||||
cmd_result = handle_command(self, user_input)
|
||||
if cmd_result is False:
|
||||
break
|
||||
elif cmd_result is True:
|
||||
continue
|
||||
# Use enhanced processing if available, otherwise fall back to basic processing
|
||||
if hasattr(self, "enhanced") and self.enhanced:
|
||||
result = self.enhanced.process_with_enhanced_context(user_input)
|
||||
if result != self.last_result:
|
||||
print(result)
|
||||
self.last_result = result
|
||||
else:
|
||||
process_message(self, user_input)
|
||||
# If cmd_result is True, the command was handled (e.g., /auto),
|
||||
# and the blocking operation will complete before the next prompt.
|
||||
# If cmd_result is None, it's not a special command, process with LLM.
|
||||
elif cmd_result is None:
|
||||
# Use enhanced processing if available, otherwise fall back to basic processing
|
||||
if hasattr(self, "enhanced") and self.enhanced:
|
||||
result = self.enhanced.process_with_enhanced_context(user_input)
|
||||
if result != self.last_result:
|
||||
print(result)
|
||||
self.last_result = result
|
||||
else:
|
||||
process_message(self, user_input)
|
||||
except EOFError:
|
||||
break
|
||||
except KeyboardInterrupt:
|
||||
@@ -487,7 +494,6 @@ class Assistant:
|
||||
def process_message(assistant, message):
|
||||
from rp.core.knowledge_context import inject_knowledge_context
|
||||
|
||||
inject_knowledge_context(assistant, message)
|
||||
# Save the user message as a fact
|
||||
import time
|
||||
import uuid
|
||||
@@ -509,6 +515,9 @@ def process_message(assistant, message):
|
||||
)
|
||||
assistant.knowledge_store.add_entry(entry)
|
||||
assistant.messages.append({"role": "user", "content": str(entry)})
|
||||
inject_knowledge_context(assistant, assistant.messages[-1]["content"])
|
||||
with ProgressIndicator("Updating memory..."):
|
||||
assistant.graph_memory.populate_from_text(message)
|
||||
logger.debug(f"Processing user message: {message[:100]}...")
|
||||
logger.debug(f"Current message count: {len(assistant.messages)}")
|
||||
with ProgressIndicator("Querying AI..."):
|
||||
|
||||
@@ -2,6 +2,7 @@ from .conversation_memory import ConversationMemory
|
||||
from .fact_extractor import FactExtractor
|
||||
from .knowledge_store import KnowledgeEntry, KnowledgeStore
|
||||
from .semantic_index import SemanticIndex
|
||||
from .graph_memory import GraphMemory
|
||||
|
||||
__all__ = [
|
||||
"KnowledgeStore",
|
||||
@@ -9,4 +10,5 @@ __all__ = [
|
||||
"SemanticIndex",
|
||||
"ConversationMemory",
|
||||
"FactExtractor",
|
||||
"GraphMemory",
|
||||
]
|
||||
|
||||
@@ -20,7 +20,7 @@ class KnowledgeEntry:
|
||||
importance_score: float = 1.0
|
||||
|
||||
def __str__(self):
|
||||
return json.dumps(self.to_dict())
|
||||
return json.dumps(self.to_dict(), indent=4, sort_keys=True,default=str)
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user