owenkaplinsky commited on
Commit
c7adf96
·
1 Parent(s): fb93b41
Files changed (2) hide show
  1. project/chat.py +5 -5
  2. project/src/index.js +2 -3
project/chat.py CHANGED
@@ -809,10 +809,10 @@ def create_gradio_interface():
809
  "parameters": {
810
  "type": "object",
811
  "properties": {
812
- # Throwaway parameter to get the agent to think about IF rules.
813
- "if_notes": {
814
  "type": "string",
815
- "description": "If you are going to make an if statement, YOU ARE REQUIRED TO USE THIS. Write the amount if IF/IFELSE/ELSE you will need. You MUST use this amount in the command. If you aren't making an if, say 'N/A'.",
816
  },
817
  "command": {
818
  "type": "string",
@@ -832,7 +832,7 @@ def create_gradio_interface():
832
  "description": "ONLY for two cases: placing value blocks into MCP output slots using 'R<N>', and placing statement blocks into specific branches of controls_if (DO0, DO1, ELSE). NEVER USE THIS PARAMETER UNLESS YOU ARE DOING ONE OF THOSE TWO EXACT THINGS.",
833
  },
834
  },
835
- "required": ["if_notes", "command"],
836
  }
837
  },
838
  {
@@ -946,7 +946,7 @@ def create_gradio_interface():
946
 
947
  # Iteration control
948
  accumulated_response = ""
949
- max_iterations = 10
950
  current_iteration = 0
951
 
952
  # Start with original user message
 
809
  "parameters": {
810
  "type": "object",
811
  "properties": {
812
+ # Throwaway parameter to get the agent to think about what it wants to do again before it does it to increase reliability.
813
+ "notes": {
814
  "type": "string",
815
+ "description": "Write the exact thing you need to make with this call. Cite your TODO list. If you're making an IF, say how many IF branches and whether it has an ELSE. Say the entire thing in plain text that your goal is.",
816
  },
817
  "command": {
818
  "type": "string",
 
832
  "description": "ONLY for two cases: placing value blocks into MCP output slots using 'R<N>', and placing statement blocks into specific branches of controls_if (DO0, DO1, ELSE). NEVER USE THIS PARAMETER UNLESS YOU ARE DOING ONE OF THOSE TWO EXACT THINGS.",
833
  },
834
  },
835
+ "required": ["notes", "command"],
836
  }
837
  },
838
  {
 
946
 
947
  # Iteration control
948
  accumulated_response = ""
949
+ max_iterations = 15
950
  current_iteration = 0
951
 
952
  # Start with original user message
project/src/index.js CHANGED
@@ -773,7 +773,6 @@ const setupUnifiedStream = () => {
773
 
774
  // Initialize the block (renders it)
775
  newBlock.initSvg();
776
- console.log('[SSE CREATE] === VERSION 2.0 - After initSvg, block type:', newBlock.type);
777
 
778
  // Apply pending controls_if mutations (must be after initSvg)
779
  try {
@@ -1368,8 +1367,8 @@ const updateCode = () => {
1368
 
1369
  // Replace Number with numbers.Number and add numbers import
1370
  if (hasNumberCheck) {
1371
- code = code.replace(/isinstance\(([^,]+),\s*Number\)/g, 'isinstance($1, numbers.Number)');
1372
- code = "import numbers\n\n" + code;
1373
  }
1374
 
1375
  code = "import gradio as gr\nimport math\n\n" + code
 
773
 
774
  // Initialize the block (renders it)
775
  newBlock.initSvg();
 
776
 
777
  // Apply pending controls_if mutations (must be after initSvg)
778
  try {
 
1367
 
1368
  // Replace Number with numbers.Number and add numbers import
1369
  if (hasNumberCheck) {
1370
+ code = code.replace(/isinstance\(([^,]+),\s*Number\)/g, 'isinstance($1, numbers_import.Number)');
1371
+ code = "import numbers as numbers_import\n\n" + code;
1372
  }
1373
 
1374
  code = "import gradio as gr\nimport math\n\n" + code