AI 生成: 基于 Flask 的 AI 免费对话应用,后端集成豆包(Doubao)和 DeepSeek,通过 SSE 实时推送消息,前端提供简洁的聊天界面。

This commit is contained in:
admin
2026-09-29 18:16:35 +08:00
commit 048dfc27f5
10 changed files with 609 additions and 0 deletions
+39
View File
@@ -0,0 +1,39 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>AI 免费对话</title>
<link rel="stylesheet" href="static/css/style.css" />
</head>
<body>
<div class="app">
<header class="header">
<h1>🤖 AI 免费对话</h1>
<div class="provider-switch">
<label>
<input type="radio" name="provider" value="deepseek" checked />
DeepSeek
</label>
<label>
<input type="radio" name="provider" value="doubao" />
豆包
</label>
</div>
</header>
<main id="chat" class="chat">
<div class="message assistant">
<div class="bubble">你好!我是 AI 助手,有什么可以帮你的吗?</div>
</div>
</main>
<footer class="composer">
<textarea id="input" placeholder="输入消息,Enter 发送,Shift+Enter 换行"></textarea>
<button id="send">发送</button>
</footer>
</div>
<script src="static/js/main.js"></script>
</body>
</html>