Use generated short id for llm asr tts

This commit is contained in:
Xin Wang
2026-02-12 19:05:50 +08:00
parent 14991af1bf
commit 28ca003662
6 changed files with 98 additions and 27 deletions

View File

@@ -1,6 +1,5 @@
import os
import time
import uuid
from typing import List, Optional
import httpx
@@ -8,6 +7,7 @@ from fastapi import APIRouter, Depends, File, Form, HTTPException, UploadFile
from sqlalchemy.orm import Session
from ..db import get_db
from ..id_generator import unique_short_id
from ..models import ASRModel
from ..schemas import (
ASRModelCreate, ASRModelUpdate, ASRModelOut,
@@ -72,7 +72,7 @@ def get_asr_model(id: str, db: Session = Depends(get_db)):
def create_asr_model(data: ASRModelCreate, db: Session = Depends(get_db)):
"""创建ASR模型"""
asr_model = ASRModel(
id=data.id or str(uuid.uuid4())[:8],
id=unique_short_id("asr", db, ASRModel),
user_id=1, # 默认用户
name=data.name,
vendor=data.vendor,