mirror of
https://github.com/JefferyHcool/BiliNote.git
synced 2026-06-06 08:10:48 +08:00
feat(model): 增加模型管理和测试功能
- 新增模型删除功能 - 实现模型测试连接功能 - 优化模型选择器组件 - 更新模型相关API和数据库操作
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user