添加llm的debug日志
This commit is contained in:
parent
2cd64981a1
commit
e6cf18fa45
@ -1,9 +1,11 @@
|
|||||||
package com.knowledge.base.infrastructure.util.http;
|
package com.knowledge.base.infrastructure.util.http;
|
||||||
|
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class SseOutputAdapter implements WriterAdapter {
|
public class SseOutputAdapter implements WriterAdapter {
|
||||||
|
|
||||||
private final SseEmitter emitter;
|
private final SseEmitter emitter;
|
||||||
@ -20,6 +22,7 @@ public class SseOutputAdapter implements WriterAdapter {
|
|||||||
|
|
||||||
// 如果 line 以 "data: " 开头,则去除该前缀
|
// 如果 line 以 "data: " 开头,则去除该前缀
|
||||||
if (line.startsWith("data: ")) {
|
if (line.startsWith("data: ")) {
|
||||||
|
log.debug("[LLM-SSE] line received: {}", line);
|
||||||
line = line.substring(6).trim();
|
line = line.substring(6).trim();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user