MCPcopy
hub / github.com/stitionai/devika / emulate_code_writing

Method emulate_code_writing

src/agents/feature/feature.py:88–108  ·  view source on GitHub ↗
(self, code_set: list, project_name: str)

Source from the content-addressed store, hash-verified

86 return f"~~~\n{response}\n~~~"
87
88 def emulate_code_writing(self, code_set: list, project_name: str):
89 files = []
90 for file in code_set:
91 filename = file["file"]
92 code = file["code"]
93
94 new_state = AgentState().new_state()
95 new_state["internal_monologue"] = "Writing code..."
96 new_state["terminal_session"]["title"] = f"Editing {filename}"
97 new_state["terminal_session"]["command"] = f"vim {filename}"
98 new_state["terminal_session"]["output"] = code
99 files.append({
100 "file": filename,
101 "code": code,
102 })
103 AgentState().add_to_current_state(project_name, new_state)
104 time.sleep(1)
105 emit_agent("code", {
106 "files": files,
107 "from": "feature"
108 })
109
110 @retry_wrapper
111 def execute(

Callers 1

executeMethod · 0.95

Calls 4

AgentStateClass · 0.90
emit_agentFunction · 0.90
new_stateMethod · 0.80
add_to_current_stateMethod · 0.80

Tested by

no test coverage detected