feat:LLM 分析文件并生成结构化建议
This commit is contained in:
@@ -55,14 +55,21 @@ def flush_tracing() -> None:
|
||||
logger.opt(exception=exc).warning("Langfuse flush 失败")
|
||||
|
||||
|
||||
async def astream_screen(graph, payload, *, thread_id, session_id=None, user_id=None):
|
||||
"""同一轮流保持同一个追踪上下文,关闭流时结束追踪"""
|
||||
async def astream_screen(
|
||||
graph, payload, *, thread_id, session_id=None, user_id=None, context=None
|
||||
):
|
||||
"""同一轮流保持同一个追踪上下文,关闭流时结束追踪;context 是图的运行上下文,不进检查点"""
|
||||
from contextlib import aclosing
|
||||
|
||||
result = {}
|
||||
with _screen_trace(payload, thread_id, session_id, user_id) as (config, root):
|
||||
async with aclosing(
|
||||
graph.astream(payload, config=config, stream_mode=["custom", "values"])
|
||||
graph.astream(
|
||||
payload,
|
||||
config=config,
|
||||
context=context,
|
||||
stream_mode=["custom", "values"],
|
||||
)
|
||||
) as events:
|
||||
async for mode, data in events:
|
||||
if mode == "values":
|
||||
|
||||
Reference in New Issue
Block a user