From a1b82635c72e36eb0af1e4f1e31b9c99075b56e2 Mon Sep 17 00:00:00 2001 From: GinHa <15201596918@163.com> Date: Tue, 11 Aug 2026 10:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=9A=E5=91=98=E7=A7=AF=E5=88=86=E6=94=B9?= =?UTF-8?q?=E7=89=88V3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- video-gen-api/app/services/generation/prompt_service.py | 2 +- video-gen-api/app/services/llm_billing/call_audit_service.py | 4 ++-- video-gen-api/app/services/llm_billing/service.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/video-gen-api/app/services/generation/prompt_service.py b/video-gen-api/app/services/generation/prompt_service.py index c944c500..666f5d40 100644 --- a/video-gen-api/app/services/generation/prompt_service.py +++ b/video-gen-api/app/services/generation/prompt_service.py @@ -157,7 +157,7 @@ async def build_prompt_with_chatapi(db: AsyncSession, record: ChatGenerationTask ) latency_ms = int((time.perf_counter() - started) * 1000) if response.status_code >= 400: - message = response.text[:1000] + message = response.text[:5000] await log_provider_call( record, provider=config.provider, diff --git a/video-gen-api/app/services/llm_billing/call_audit_service.py b/video-gen-api/app/services/llm_billing/call_audit_service.py index 331b14aa..cd928bc6 100644 --- a/video-gen-api/app/services/llm_billing/call_audit_service.py +++ b/video-gen-api/app/services/llm_billing/call_audit_service.py @@ -245,14 +245,14 @@ async def finish_call_failure(ctx: LlmBillingContext, *, error: str, status: str # 供应商已成功并已记录 Token;后续解析/校验/落库失败只能记为后处理失败, # 不能覆盖真实供应商成功事实,也不能重复累计失败调用次数。 attempt.postprocess_status = "failed" - attempt.postprocess_error = str(error)[:1000] + attempt.postprocess_error = str(error)[:5000] return "postprocess_failure" if attempt.status != LlmCallAttemptStatus.STARTED.value: return "noop" attempt.status = LlmCallAttemptStatus.TIMEOUT.value if status == "timeout" else LlmCallAttemptStatus.FAILED.value attempt.response_received_at = now attempt.duration_ms = max(0, int((now - attempt.request_started_at).total_seconds() * 1000)) - attempt.error_message = str(error)[:1000] + attempt.error_message = str(error)[:5000] attempt.token_unavailable_reason = "供应商调用失败,未返回Token使用量" execution_result = await db.execute( select(LlmBillingExecution) diff --git a/video-gen-api/app/services/llm_billing/service.py b/video-gen-api/app/services/llm_billing/service.py index 2d24a88c..7566173a 100644 --- a/video-gen-api/app/services/llm_billing/service.py +++ b/video-gen-api/app/services/llm_billing/service.py @@ -463,7 +463,7 @@ async def refund_on_final_failure(db: AsyncSession, ctx: LlmBillingContext, *, e # 调用方只有在业务最终失败时才能进这里;允许从业务成功调用记录转最终失败退款。 pass execution.status = LlmBillingExecutionStatus.FINAL_FAILED.value - execution.final_error_message = str(error or "业务最终失败")[:1000] + execution.final_error_message = str(error or "业务最终失败")[:5000] execution.completed_at = utc_now() _log(ctx, LlmBillingEvent.FINAL_FAILURE_START, status="started", error=error) try: @@ -534,7 +534,7 @@ async def finalize_llm_business_failure( execution = await _find_execution(audit_session, ctx, for_update=True) if execution is not None and execution.status != LlmBillingExecutionStatus.REFUNDED.value: execution.status = LlmBillingExecutionStatus.REFUND_FAILED.value - execution.final_error_message = str(error or exc)[:1000] + execution.final_error_message = str(error or exc)[:5000] execution.completed_at = utc_now() except Exception: _log(ctx, LlmBillingEvent.FINAL_FAILURE_REFUND_FAILED, status="failed", error=str(exc), persist_failed_status=False)