修改了文件系统架构
This commit is contained in:
1 parent
dc246b0d91
commit
4a4bd5c365
30 files changed
+29
-5
No files matched your search
@@ -37,7 +37,7 @@ RAG_BASE_URL – RAG 嵌入与重排序服务地址(可选)
|
||||
cd ./Agent
|
||||
export PYTHONPATH=src:$PYTHONPATH # Linux/macOS
|
||||
# 或 Windows PowerShell: $env:PYTHONPATH="src;$env:PYTHONPATH"
|
||||
uvicorn agent.web.server:app --host 127.0.0.1 --port 8765
|
||||
uvicorn web.server:app --host 0.0.0.0 --port 8765
|
||||
|
||||
# (可选)通过 Cloudflare Tunnel 暴露公网
|
||||
cloudflared tunnel --url http://localhost:8765
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -13,7 +13,7 @@ from agent.utils.agent_utils import (
|
||||
get_session_meta,
|
||||
update_session_meta,
|
||||
)
|
||||
from agent.web.ui_session import (
|
||||
from web.ui_session import (
|
||||
rewrite_user_message_files_to_session_dir,
|
||||
session_dir,
|
||||
sync_manifest_from_chat_history,
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"version": 2,
|
||||
"turns": [
|
||||
{
|
||||
"user": {
|
||||
"content": [
|
||||
{
|
||||
"type": "text",
|
||||
"text": "你好"
|
||||
}
|
||||
]
|
||||
},
|
||||
"assistant": {
|
||||
"text": "你好!很高兴能帮到你。\n\n如果你有图片、文件需要解读,或者有任何问题想要咨询,随时可以发给我或告诉我。请问有什么我可以帮你的吗?",
|
||||
"output_type": "text",
|
||||
"autoplay": false,
|
||||
"audio_duration_seconds": null,
|
||||
"audio_relpath": null
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -316,6 +316,7 @@ class ChatQwen(ChatOpenAI):
|
||||
lc_msg.content = merged
|
||||
elif raw_content:
|
||||
lc_msg.content = raw_content
|
||||
# print(f"raw_content={raw_content!r}, merged={merged!r}, final={lc_msg.content!r}")
|
||||
content_text = lc_msg.content if isinstance(lc_msg.content, str) else ""
|
||||
pattern = re.compile(r'<tool_call>\s*(.*?)\s*</tool_call>', re.DOTALL)
|
||||
matches = pattern.findall(content_text)
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -279,4 +279,5 @@ def assistant_text(value) -> str:
|
||||
return json.dumps(value, ensure_ascii=False)
|
||||
except TypeError:
|
||||
return str(value).strip()
|
||||
return str(value).strip()
|
||||
return str(value).strip()
|
||||
|
||||
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
@@ -1366,6 +1366,6 @@
|
||||
|
||||
bootstrap().catch((e) => {
|
||||
chatPlaceholder.hidden = false;
|
||||
chatPlaceholder.innerHTML = `<h3>无法连接服务</h3><p>${escapeHtml(e.message)}</p><p class="muted">请从 Agent 目录执行:<code>uvicorn agent.web.server:app --reload --host 127.0.0.1 --port 8765</code>,并保证 PYTHONPATH 包含 <code>src</code>。</p>`;
|
||||
chatPlaceholder.innerHTML = `<h3>无法连接服务</h3><p>${escapeHtml(e.message)}</p><p class="muted">请从 Agent 目录执行:<code>uvicorn web.server:app --reload --host 127.0.0.1 --port 8765</code>,并保证 PYTHONPATH 包含 <code>src</code>。</p>`;
|
||||
});
|
||||
})();
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -25,7 +25,7 @@ if str(_SRC) not in sys.path:
|
||||
sys.path.insert(0, str(_SRC))
|
||||
|
||||
from agent import chatbot_agent as ca # noqa: E402
|
||||
from agent.web import ui_session as ui # noqa: E402
|
||||
from web import ui_session as ui # noqa: E402
|
||||
from agent.utils.image_utils import IMAGE_FILE_EXTENSIONS # noqa: E402
|
||||
|
||||
_WEB_DIR = Path(__file__).resolve().parent
|
||||
File renamed without changes.
Reference in new issue
Block a user