Refa: OpenAI whisper-1 (#9552)

### What problem does this PR solve?

Refactor OpenAI to enable audio parsing.

### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
- [x] Refactoring
This commit is contained in:
Yongteng Lei
2025-08-19 16:41:18 +08:00
committed by GitHub
parent 05ee1be1e9
commit 787e0c6786
4 changed files with 75 additions and 24 deletions

View File

@ -41,6 +41,9 @@ def set_dialog():
return get_data_error_result(message="Dialog name can't be empty.")
if len(name.encode("utf-8")) > 255:
return get_data_error_result(message=f"Dialog name length is {len(name)} which is larger than 255")
if DialogService.get_or_none(tenant_id=current_user.id, name=name):
return get_data_error_result(message=f"Duplicated Dialog name {name}.")
description = req.get("description", "A helpful dialog")
icon = req.get("icon", "")
top_n = req.get("top_n", 6)