igerasimov commited on
Commit
01f2945
·
1 Parent(s): 5bb9f76

perf: keywords nodes do not use Pydantic structured output

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -98,7 +98,8 @@ def classify_individual_topic(topic_name: str):
98
  # Enforce JSON list output natively
99
  #result = structured_llm.invoke(prompt.format(title=state["title"], abstract=state["abstract"], sub_tree=target_sub_tree))
100
  result = llm.invoke(prompt.format(title=state["title"], abstract=state["abstract"], sub_tree=target_sub_tree))
101
- raw_keywords = [k.strip() for k in result.keywords if k.strip()]
 
102
 
103
  # Immediate validation pass inside the node branch
104
  valid_set = set()
 
98
  # Enforce JSON list output natively
99
  #result = structured_llm.invoke(prompt.format(title=state["title"], abstract=state["abstract"], sub_tree=target_sub_tree))
100
  result = llm.invoke(prompt.format(title=state["title"], abstract=state["abstract"], sub_tree=target_sub_tree))
101
+ #raw_keywords = [k.strip() for k in result.keywords if k.strip()]
102
+ raw_keywords = [k.strip() for k in result.content.split(",") if k.strip()]
103
 
104
  # Immediate validation pass inside the node branch
105
  valid_set = set()