支持局域网 GPU OCR 服务,配置方式类似 Ollama。
This commit is contained in:
@@ -31,6 +31,7 @@ def settings_to_out(row: SystemSettings) -> SystemSettingsOut:
|
||||
openai_base_url=row.openai_base_url,
|
||||
openai_model=row.openai_model,
|
||||
openai_api_key_set=bool(row.openai_api_key),
|
||||
ocr_service_url=row.ocr_service_url,
|
||||
updated_at=row.updated_at,
|
||||
)
|
||||
|
||||
@@ -74,6 +75,8 @@ def update_settings(
|
||||
row.openai_model = data.openai_model or None
|
||||
if data.openai_api_key is not None and data.openai_api_key.strip():
|
||||
row.openai_api_key = data.openai_api_key.strip()
|
||||
if data.ocr_service_url is not None:
|
||||
row.ocr_service_url = data.ocr_service_url.strip() or None
|
||||
row.updated_at = datetime.now(timezone.utc)
|
||||
db.commit()
|
||||
db.refresh(row)
|
||||
|
||||
Reference in New Issue
Block a user