auto-coder-web 0.1.102__py3-none-any.whl → 0.1.104__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.
- auto_coder_web/routers/coding_router.py +21 -18
- auto_coder_web/version.py +1 -1
- auto_coder_web/web/assets/main-BPF_xhU6.css +32 -0
- auto_coder_web/web/assets/main.js +249 -249
- auto_coder_web/web/index.html +1 -1
- {auto_coder_web-0.1.102.dist-info → auto_coder_web-0.1.104.dist-info}/METADATA +2 -2
- {auto_coder_web-0.1.102.dist-info → auto_coder_web-0.1.104.dist-info}/RECORD +10 -10
- auto_coder_web/web/assets/main-DgQa03WG.css +0 -32
- {auto_coder_web-0.1.102.dist-info → auto_coder_web-0.1.104.dist-info}/WHEEL +0 -0
- {auto_coder_web-0.1.102.dist-info → auto_coder_web-0.1.104.dist-info}/entry_points.txt +0 -0
- {auto_coder_web-0.1.102.dist-info → auto_coder_web-0.1.104.dist-info}/top_level.txt +0 -0
@@ -60,23 +60,31 @@ def ensure_task_dir(project_path: str) -> str:
|
|
60
60
|
return task_dir
|
61
61
|
|
62
62
|
@byzerllm.prompt()
|
63
|
-
def coding_prompt(messages: List[Dict[str, Any]],
|
64
|
-
'''
|
65
|
-
|
66
|
-
<messages>
|
63
|
+
def coding_prompt(messages: List[Dict[str, Any]], query: str):
|
64
|
+
'''
|
65
|
+
【历史对话】按时间顺序排列,从旧到新:
|
67
66
|
{% for message in messages %}
|
68
67
|
<message>
|
69
|
-
|
70
|
-
<content>
|
68
|
+
{% if message.type == "USER" or message.type == "USER_RESPONSE" or message.metadata.path == "/agent/edit/tool/result" %}【用户】{% else %}【助手】{% endif %}
|
69
|
+
<content>
|
70
|
+
{{ message.content }}
|
71
|
+
</content>
|
71
72
|
</message>
|
72
73
|
{% endfor %}
|
73
|
-
</messages>
|
74
74
|
|
75
|
-
|
76
|
-
<
|
77
|
-
{{
|
78
|
-
</
|
75
|
+
【当前问题】用户的最新需求如下:
|
76
|
+
<current_query>
|
77
|
+
{{ query }}
|
78
|
+
</current_query>
|
79
79
|
'''
|
80
|
+
# 使用消息解析器处理消息
|
81
|
+
from auto_coder_web.agentic_message_parser import parse_messages
|
82
|
+
processed_messages = parse_messages(messages)
|
83
|
+
|
84
|
+
return {
|
85
|
+
"messages": processed_messages,
|
86
|
+
"query": query
|
87
|
+
}
|
80
88
|
|
81
89
|
@router.post("/api/coding-command")
|
82
90
|
async def coding_command(request: CodingCommandRequest, project_path: str = Depends(get_project_path)):
|
@@ -113,14 +121,9 @@ async def coding_command(request: CodingCommandRequest, project_path: str = Depe
|
|
113
121
|
chat_data = get_chat_list_sync(project_path, current_session_name)
|
114
122
|
|
115
123
|
# 从聊天历史中提取消息
|
116
|
-
for msg in chat_data.get("messages", []):
|
117
|
-
# 只保留用户和中间结果信息
|
118
|
-
if msg.get("type","") not in ["USER_RESPONSE","RESULT"]:
|
119
|
-
continue
|
120
|
-
|
124
|
+
for msg in chat_data.get("messages", []):
|
121
125
|
if msg.get("contentType","") in ["token_stat"]:
|
122
|
-
continue
|
123
|
-
|
126
|
+
continue
|
124
127
|
messages.append(msg)
|
125
128
|
except Exception as e:
|
126
129
|
logger.error(f"Error reading chat history: {str(e)}")
|
auto_coder_web/version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = "0.1.
|
1
|
+
__version__ = "0.1.104"
|