mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-09 07:42:39 +02:00
feat: unified credits and its cost calculations
This commit is contained in:
parent
451a98936e
commit
ae9d36d77f
61 changed files with 5835 additions and 272 deletions
|
|
@ -68,12 +68,25 @@ class EtlPipelineService:
|
|||
etl_service="VISION_LLM",
|
||||
content_type="image",
|
||||
)
|
||||
except Exception:
|
||||
logging.warning(
|
||||
"Vision LLM failed for %s, falling back to document parser",
|
||||
request.filename,
|
||||
exc_info=True,
|
||||
)
|
||||
except Exception as exc:
|
||||
# Special-case quota exhaustion so we log a clearer message
|
||||
# — the vision LLM didn't "fail", the user just ran out of
|
||||
# premium credit. Falling through to the document parser
|
||||
# is a graceful degradation: OCR/Unstructured still
|
||||
# extracts text from the image without burning credit.
|
||||
from app.services.billable_calls import QuotaInsufficientError
|
||||
|
||||
if isinstance(exc, QuotaInsufficientError):
|
||||
logging.info(
|
||||
"Vision LLM quota exhausted for %s; falling back to document parser",
|
||||
request.filename,
|
||||
)
|
||||
else:
|
||||
logging.warning(
|
||||
"Vision LLM failed for %s, falling back to document parser",
|
||||
request.filename,
|
||||
exc_info=True,
|
||||
)
|
||||
else:
|
||||
logging.info(
|
||||
"No vision LLM provided, falling back to document parser for %s",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue