Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 16 additions & 14 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,21 +379,23 @@ def exec(self, prep_res):
try:
from_idx = int(str(rel["from_abstraction"]).split("#")[0].strip())
to_idx = int(str(rel["to_abstraction"]).split("#")[0].strip())
if not (
0 <= from_idx < num_abstractions and 0 <= to_idx < num_abstractions
):
raise ValueError(
f"Invalid index in relationship: from={from_idx}, to={to_idx}. Max index is {num_abstractions-1}."
)
validated_relationships.append(
{
"from": from_idx,
"to": to_idx,
"label": rel["label"], # Potentially translated label
}
)
except (ValueError, TypeError):
raise ValueError(f"Could not parse indices from relationship: {rel}")
print(f"Warning: Could not parse indices from relationship, skipping: {rel}")
continue
if not (
0 <= from_idx < num_abstractions and 0 <= to_idx < num_abstractions
):
print(
f"Warning: Invalid index in relationship (from={from_idx}, to={to_idx}, max={num_abstractions-1}), skipping."
)
continue
validated_relationships.append(
{
"from": from_idx,
"to": to_idx,
"label": rel["label"], # Potentially translated label
}
)

print("Generated project summary and relationship details.")
return {
Expand Down