Skip to content

Commit

Permalink
refactor: chat messages
Browse files Browse the repository at this point in the history
  • Loading branch information
hyacinthus committed Feb 13, 2025
1 parent efc69d9 commit 53b20de
Show file tree
Hide file tree
Showing 19 changed files with 529 additions and 298 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# Changelog

## 2025-02-13

### New Features
- All chats will be saved in the db table chat_messages

### Breaking Changes
- Remove config.debug_resp flag, you can only use debug endpoint for debugging
- Remove config.autonomous_memory_public, the autonomous task will always use chat id "autonomous"

## 2025-02-11

### Improvements
Expand All @@ -19,7 +28,7 @@
## 2025-02-03

### Breaking Changes
- Use async every where
- Use async everywhere

## 2025-02-02

Expand Down
8 changes: 0 additions & 8 deletions app/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ def __init__(self):
# ==== this part can be load from env or aws secrets manager
self.db["auto_migrate"] = self.load("DB_AUTO_MIGRATE", "true") == "true"
self.debug = self.load("DEBUG") == "true"
self.debug_resp = (
self.load("DEBUG_RESP", "false") == "true"
) # Agent response with thought steps and time cost
self.debug_checkpoint = (
self.load("DEBUG_CHECKPOINT", "false") == "true"
) # log with checkpoint
Expand All @@ -81,11 +78,6 @@ def __init__(self):
self.openai_api_key = self.load("OPENAI_API_KEY")
self.deepseek_api_key = self.load("DEEPSEEK_API_KEY")
self.system_prompt = self.load("SYSTEM_PROMPT")
# Autonomous
# self.autonomous_entrypoint_interval = int(
# self.load("AUTONOMOUS_ENTRYPOINT_INTERVAL", "1")
# )
self.autonomous_memory_public = self.load("AUTONOMOUS_MEMORY_PUBLIC", "true")
# Telegram server settings
self.tg_base_url = self.load("TG_BASE_URL")
self.tg_server_host = self.load("TG_SERVER_HOST", "127.0.0.1")
Expand Down
2 changes: 1 addition & 1 deletion app/core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ExecuteRequest(BaseModel):


@core_router.post("/execute")
async def execute(message: ChatMessage, debug: bool = False) -> list[str]:
async def execute(message: ChatMessage, debug: bool = False) -> list[ChatMessage]:
"""Execute an agent with the given input and return response lines.
Args:
Expand Down
2 changes: 1 addition & 1 deletion app/core/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from models.chat import ChatMessage


async def execute_agent(message: ChatMessage, debug: bool = False) -> list[str]:
async def execute_agent(message: ChatMessage, debug: bool = False) -> list[ChatMessage]:
"""Execute an agent with environment-aware routing.
In local environment, directly calls the local execute_agent function.
Expand Down
Loading

0 comments on commit 53b20de

Please sign in to comment.