Cyber Catalyst Team commited on
Commit
e2e79bf
·
1 Parent(s): fe85614

feat: add timeout=8.0 to NIM completions calls and update AGENTIC_SYSTEM_PROMPT to suppress greetings

Browse files
Files changed (1) hide show
  1. backend.py +7 -3
backend.py CHANGED
@@ -651,6 +651,7 @@ IMPORTANT RULES:
651
  - If a command fails, read the error and fix it.
652
  - Work in the /tmp/workspace directory.
653
  - Be concise in your explanations, but thorough in your tool usage.
 
654
  """
655
 
656
 
@@ -1799,7 +1800,8 @@ async def forge_execute(req: ForgeExecuteRequest, authorization: str = Header(No
1799
  model=RECOMMENDED_MODEL,
1800
  messages=final_messages,
1801
  tools=TOOLS,
1802
- tool_choice="auto"
 
1803
  )
1804
  except Exception as e:
1805
  log_activity(f"[Forge Fallback] NIM completions failed: {e}. Retrying with Mistral Large...")
@@ -2000,7 +2002,8 @@ async def execute_build_cycle(project_name: str, goal: str):
2000
  res = await nim_client.chat.completions.create(
2001
  model=RECOMMENDED_MODEL,
2002
  messages=[{"role": "user", "content": plan_prompt}],
2003
- max_tokens=1024
 
2004
  )
2005
  raw = res.choices[0].message.content.strip()
2006
  except Exception as e:
@@ -2138,7 +2141,8 @@ async def execute_eternity_cycle(project_name: str, goal: str):
2138
  res = await nim_client.chat.completions.create(
2139
  model=RECOMMENDED_MODEL,
2140
  messages=[{"role": "user", "content": plan_prompt}],
2141
- max_tokens=1024
 
2142
  )
2143
  raw = res.choices[0].message.content.strip()
2144
  except Exception as e:
 
651
  - If a command fails, read the error and fix it.
652
  - Work in the /tmp/workspace directory.
653
  - Be concise in your explanations, but thorough in your tool usage.
654
+ - You are running in a multi-round tool-execution loop. Do NOT output redundant greetings (e.g. "Hey saumil!", "Let me check...", "Ready to build...") in intermediate rounds. Only output them in your first response if appropriate. Be direct and proceed with tool calls.
655
  """
656
 
657
 
 
1800
  model=RECOMMENDED_MODEL,
1801
  messages=final_messages,
1802
  tools=TOOLS,
1803
+ tool_choice="auto",
1804
+ timeout=8.0
1805
  )
1806
  except Exception as e:
1807
  log_activity(f"[Forge Fallback] NIM completions failed: {e}. Retrying with Mistral Large...")
 
2002
  res = await nim_client.chat.completions.create(
2003
  model=RECOMMENDED_MODEL,
2004
  messages=[{"role": "user", "content": plan_prompt}],
2005
+ max_tokens=1024,
2006
+ timeout=8.0
2007
  )
2008
  raw = res.choices[0].message.content.strip()
2009
  except Exception as e:
 
2141
  res = await nim_client.chat.completions.create(
2142
  model=RECOMMENDED_MODEL,
2143
  messages=[{"role": "user", "content": plan_prompt}],
2144
+ max_tokens=1024,
2145
+ timeout=8.0
2146
  )
2147
  raw = res.choices[0].message.content.strip()
2148
  except Exception as e: