feat: 增强聊天功能和 markdown 渲染

- 优化聊天 UI 组件交互体验
- 扩展 markdown 渲染功能支持
- 更新类型定义
- 重构 LLM 聊天处理逻辑
- 更新模型提供商种子数据
This commit is contained in:
freedakgmail
2026-06-23 00:46:08 +08:00
parent 95dee5a70e
commit d31bdd1261
5 changed files with 424 additions and 160 deletions
+8 -2
View File
@@ -26,6 +26,12 @@ func main() {
defer pool.Close()
// 插入阿里云百炼(通义千问)配置
apiKey := os.Getenv("QWEN_API_KEY")
if apiKey == "" {
log.Println("⚠️ QWEN_API_KEY 未设置,跳过初始化千问")
return
}
sql := `
INSERT INTO model_providers (
name,
@@ -38,7 +44,7 @@ func main() {
) VALUES (
'阿里云百炼 (通义千问)',
'https://dashscope.aliyuncs.com/compatible-mode/v1',
'sk-c0c5174892c44ff48d587cd040fbdd40',
$1,
'[
{"id": "qwen-plus", "name": "通义千问-Plus", "type": "chat"},
{"id": "qwen-turbo", "name": "通义千问-Turbo", "type": "chat"},
@@ -57,7 +63,7 @@ func main() {
ON CONFLICT DO NOTHING
`
_, err = pool.Exec(ctx, sql)
_, err = pool.Exec(ctx, sql, apiKey)
if err != nil {
log.Fatalf("插入数据失败: %v", err)
}