This commit is contained in:
2026-04-16 15:45:00 +08:00
parent 6363267bca
commit 91b63675eb
43 changed files with 5652 additions and 853 deletions

View File

@@ -182,6 +182,19 @@ export class UpstreamLlmClient {
? options.debugLabel.trim()
: undefined;
const enableDebugLog = this.config.rawEnv.LLM_DEBUG_LOG === 'true';
if (enableDebugLog) {
this.logger.info(
{
llm_model: model,
llm_debug_label: debugLabel,
llm_messages: body.messages,
},
'[LLM_DEBUG] Request prompt',
);
}
this.logger.debug(
{
llm_model: model,
@@ -281,6 +294,18 @@ export class UpstreamLlmClient {
throw upstreamError('LLM 返回内容为空');
}
const enableDebugLog = this.config.rawEnv.LLM_DEBUG_LOG === 'true';
if (enableDebugLog) {
this.logger.info(
{
llm_debug_label: params.debugLabel,
llm_response_content: content,
llm_response_length: content.length,
},
'[LLM_DEBUG] Response content',
);
}
return content;
}