Spaces:
Running
Running
Update state.py
Browse files
state.py
CHANGED
|
@@ -1,21 +1,22 @@
|
|
| 1 |
# state.py — Shared State for Autonomous Python Coding Agent
|
| 2 |
|
| 3 |
-
from typing import TypedDict
|
| 4 |
|
| 5 |
|
| 6 |
class State(TypedDict):
|
| 7 |
-
task: str
|
| 8 |
-
plan: str
|
| 9 |
-
code: str
|
| 10 |
-
test_result: str
|
| 11 |
-
error: str
|
| 12 |
-
fixed_code: str
|
| 13 |
explanation: str
|
| 14 |
review: str
|
| 15 |
final_code: str
|
| 16 |
retries: int
|
| 17 |
security_retries: int
|
| 18 |
complexity_retries: int
|
|
|
|
| 19 |
passed: bool
|
| 20 |
is_secure: bool
|
| 21 |
is_simple: bool
|
|
@@ -26,4 +27,3 @@ class State(TypedDict):
|
|
| 26 |
reflection_ok: bool
|
| 27 |
reflection_notes: str
|
| 28 |
confidence_score: int
|
| 29 |
-
feedback: str
|
|
|
|
| 1 |
# state.py — Shared State for Autonomous Python Coding Agent
|
| 2 |
|
| 3 |
+
from typing import TypedDict # pyhton class that lets us to define dictionary with specific key names
|
| 4 |
|
| 5 |
|
| 6 |
class State(TypedDict):
|
| 7 |
+
task: str # original user requests
|
| 8 |
+
plan: str # plans before writing code
|
| 9 |
+
code: str # code generated by this
|
| 10 |
+
test_result: str # this stores what happened when code is generated it failed crashed or passed ?
|
| 11 |
+
error: str # message if code execution failed or not ?
|
| 12 |
+
fixed_code: str # fixed code
|
| 13 |
explanation: str
|
| 14 |
review: str
|
| 15 |
final_code: str
|
| 16 |
retries: int
|
| 17 |
security_retries: int
|
| 18 |
complexity_retries: int
|
| 19 |
+
reflection_retries: int # own counter — reflection loop no longer piggybacks on "retries"
|
| 20 |
passed: bool
|
| 21 |
is_secure: bool
|
| 22 |
is_simple: bool
|
|
|
|
| 27 |
reflection_ok: bool
|
| 28 |
reflection_notes: str
|
| 29 |
confidence_score: int
|
|
|