Skip to content

Commit ec1f533

Browse files
authored
Merge pull request #61 from chatchat-space/dev
Dev
2 parents 13e4593 + 6e8c4df commit ec1f533

File tree

4 files changed

+511
-293
lines changed

4 files changed

+511
-293
lines changed

libs/chatchat-server/chatchat/server/agent/graphs_factory/base_rag.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@ class Grade(BaseModel):
172172
scored_result = await referee.ainvoke(state)
173173
score = scored_result.binary_score
174174

175+
if score is None or score == "":
176+
logger.warning(f"The score is not provided. Defaulting to 'yes'. Question: {state['question']}")
177+
score = "yes"
178+
175179
if score == "yes":
176180
return "generate"
177181
else:

libs/chatchat-server/chatchat/webui_pages/utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -822,7 +822,9 @@ async def process_graph(graph_class: Graph, graph: CompiledStateGraph, graph_inp
822822
response_last = ""
823823
async for event in events:
824824
node, response = extract_node_and_response(event)
825+
825826
# debug
827+
# import rich
826828
# print(f"--- node: {node} ---")
827829
# rich.print(response)
828830

@@ -833,7 +835,11 @@ async def process_graph(graph_class: Graph, graph: CompiledStateGraph, graph_inp
833835
response = graph_class.handle_event(node=node, event=response)
834836
# 将 event 转化为 json
835837
response = serialize_content_to_json(response)
836-
# rich.print(response)
838+
839+
# debug
840+
import rich
841+
print(f"--- node: {node} ---")
842+
rich.print(response)
837843

838844
# 检查 'content' 是否在响应中(因为我们只需要 AIMessage 的内容)
839845
if "content" in response:

0 commit comments

Comments
 (0)