Getting error: Could not parse indices from relationship
python main.py --dir /home/test/test/ -i '.py' '.js'
File "/home/test/CODEBASE_KNOWLEDGE/nodes.py", line 385, in exec raise ValueError( ValueError: Invalid index in relationship: from=9, to=10. Max index is 9.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/test/CODEBASE_KNOWLEDGE/main.py", line 111, in
Can you give some pointers to resolve this?
model: "gpt-oss:120b", Ollama
I'm also running gpt-oss:120b using Ollama and getting the exact same error.
@saiaprameya , what does your utils/call_llm.py look like? Here's mine (I changed the model I'm running since I last pushed):
https://github.com/bhollan/PocketFlow-Tutorial-Codebase-Knowledge/blob/main/utils/call_llm.py
Most relevant bit:
# Call Ollama local model
try:
response = requests.post(
"http://localhost:11434/api/generate",
json={
"model": os.getenv("OLLAMA_MODEL", "gpt-oss:120b"),
"stream":False,
"prompt": prompt,
# "messages": [{"role": "user", "content": prompt}]
},
timeout=60
)
response.raise_for_status()
response_data = response.json()
response_text = response_data.get("response", "")
# response_text = response_data.get("message", {}).get("content", "")
except Exception as e:
logger.error(f"Ollama API call failed: {e}")
raise
I also found this one that's a good thread:
https://github.com/The-Pocket/PocketFlow-Tutorial-Codebase-Knowledge/issues/13
It finally worked for me when running qwen3 via ollama. I think the problem was sending the request to /generate via prompt instead of to /chat via messages[]:
# Call Ollama local model
try:
response = requests.post(
"http://localhost:11434/api/chat",
json={
# "model": os.getenv("OLLAMA_MODEL"),
"model": "qwen3:latest",
"stream":False,
# "prompt": prompt,
"messages": [{"role": "user", "content": prompt}]
},
timeout=600
)
response.raise_for_status()
response_data = response.json()
# response_text = response_data.get("response", "")
response_text = response_data.get("message", {}).get("content", "")
except Exception as e:
logger.error(f"Ollama API call failed: {e}")
raise
@bhollan Thanks Brian. Will test it out with your suggestions.