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

Method run

examples/workflow/custom_code.py:9–16  ·  view source on GitHub ↗
(self, inputs: Union[str, List[Message]],
                  **kwargs)

Source from the content-addressed store, hash-verified

7class CustomCodeAgent(CodeAgent):
8
9 async def run(self, inputs: Union[str, List[Message]],
10 **kwargs) -> List[Message]:
11 print(f'Code executed in {self.tag}!')
12 if isinstance(inputs, str):
13 # This example doesn't handle string inputs, so convert to a list of one message
14 inputs = [Message(role='user', content=inputs)]
15 inputs.append(Message(role='user', content='Calculate1+1'))
16 return inputs

Callers 5

validate_documentFunction · 0.45
_get_git_word_diffMethod · 0.45
run.pyFile · 0.45

Calls 1

MessageClass · 0.90

Tested by

no test coverage detected