1
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user