MCPcopy Create free account
hub / github.com/modelscope/ms-agent / run

Method run

projects/code_genesis/workflow/refine.py:89–116  ·  view source on GitHub ↗
(self, messages, **kwargs)

Source from the content-addressed store, hash-verified

87 return await self.refine_condenser.run([m for m in messages])
88
89 async def run(self, messages, **kwargs):
90 with open(os.path.join(self.output_dir, 'topic.txt')) as f:
91 topic = f.read()
92 with open(os.path.join(self.output_dir, 'framework.txt')) as f:
93 framework = f.read()
94 with open(os.path.join(self.output_dir, 'protocol.txt')) as f:
95 protocol = f.read()
96 with open(os.path.join(self.output_dir, 'tasks.txt')) as f:
97 file_info = f.read()
98
99 file_relation = OrderedDict()
100 CodingAgent.refresh_file_status(self, file_relation)
101 CodingAgent.construct_file_information(self, file_relation, False)
102 messages = [
103 Message(role='system', content=self.config.prompt.system),
104 Message(
105 role='user',
106 content=f'Original requirements (topic.txt): {topic}\n'
107 f'Tech stack (framework.txt): {framework}\n'
108 f'Communication protocol (protocol.txt): {protocol}\n'
109 f'File list:\n{file_info}\n'
110 f'The shell_executor runs inside a Docker sandbox. '
111 f'Project files are at the current working directory (/data). '
112 f'All relative paths work directly.\n'
113 f'When creating the deployment zip file, name it workspace.zip.\n'
114 f'Please refine the project and deploy it to EdgeOne Pages:'),
115 ]
116 return await super().run(messages, **kwargs)
117
118 async def after_tool_call(self, messages: List[Message]):
119 await super().after_tool_call(messages)

Callers 2

write_codeMethod · 0.45
condense_memoryMethod · 0.45

Calls 3

MessageClass · 0.90
refresh_file_statusMethod · 0.80

Tested by

no test coverage detected