feat(model): 增加模型管理和测试功能

- 新增模型删除功能
- 实现模型测试连接功能
- 优化模型选择器组件
- 更新模型相关API和数据库操作
This commit is contained in:
JefferyHcool
2025-05-26 23:16:49 +08:00
parent 9b298d3094
commit be3db5faaf
2 changed files with 27 additions and 2 deletions

View File

@@ -14,6 +14,15 @@ def init_model_table():
conn.commit()
conn.close()
def get_model_by_provider_and_name(provider_id: int, model_name: str):
conn = get_connection()
cursor = conn.execute(
"SELECT * FROM models WHERE provider_id = ? AND model_name = ?",
(provider_id, model_name)
)
row = cursor.fetchone()
return row
# 插入模型
def insert_model(provider_id: int, model_name: str):
conn = get_connection()