prthm11 commited on
Commit
99bcb1e
·
verified ·
1 Parent(s): 4109944

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -1290,9 +1290,11 @@ If you find any "Code-Blocks" then,
1290
  ]
1291
 
1292
  try:
 
1293
  # Invoke the main agent for logic refinement and relationship identification
1294
- response = agent.invoke({"messages": [{"role": "user", "content": content}]})
1295
- llm_output_raw = response["messages"][-1].content.strip()
 
1296
  print(f"llm_output_raw: {response}")
1297
  parsed_llm_output = extract_json_from_llm_response(llm_output_raw)
1298
  result = parsed_llm_output
@@ -1313,8 +1315,9 @@ If you find any "Code-Blocks" then,
1313
  "Corrected JSON:\n"
1314
  )
1315
  try:
1316
- correction_response = agent_json_resolver.invoke({"messages": [{"role": "user", "content": correction_prompt}]})
1317
- corrected_output = extract_json_from_llm_response(correction_response['messages'][-1].content)
 
1318
  #block_relationships = corrected_output.get("block_relationships", [])
1319
  result = corrected_output
1320
  print(f"result:\n\n {result}")
 
1290
  ]
1291
 
1292
  try:
1293
+ return
1294
  # Invoke the main agent for logic refinement and relationship identification
1295
+ # response = agent.invoke({"messages": [{"role": "user", "content": content}]})
1296
+ # llm_output_raw = response["messages"][-1].content.strip()
1297
+ llm_output_raw = ""
1298
  print(f"llm_output_raw: {response}")
1299
  parsed_llm_output = extract_json_from_llm_response(llm_output_raw)
1300
  result = parsed_llm_output
 
1315
  "Corrected JSON:\n"
1316
  )
1317
  try:
1318
+ # correction_response = agent_json_resolver.invoke({"messages": [{"role": "user", "content": correction_prompt}]})
1319
+ # corrected_output = extract_json_from_llm_response(correction_response['messages'][-1].content)
1320
+ corrected_output = extract_json_from_llm_response(llm_output_raw)
1321
  #block_relationships = corrected_output.get("block_relationships", [])
1322
  result = corrected_output
1323
  print(f"result:\n\n {result}")