MCPcopy Create free account
hub / github.com/ev-sys/evsys-sdk / run

Method run

tests/harbor_echo_agent.py:36–56  ·  view source on GitHub ↗
(
        self,
        instruction: str,
        environment: BaseEnvironment,
        context: AgentContext,
    )

Source from the content-addressed store, hash-verified

34 return None
35
36 async def run(
37 self,
38 instruction: str,
39 environment: BaseEnvironment,
40 context: AgentContext,
41 ) -> None:
42 text = f"{self._prefix}{instruction}"
43 toks = list(range(1, len(text.split()) + 2))
44 context.n_input_tokens = len(instruction.split())
45 context.n_output_tokens = len(toks)
46 context.rollout_details = [{
47 "prompt_token_ids": [list(range(context.n_input_tokens))],
48 "completion_token_ids": [toks],
49 "logprobs": [[-0.1] * len(toks)],
50 }]
51 # write the completion to the agent dir so the host-side EvsysVerifier
52 # (run by harbor) can score it
53 logs_dir = getattr(self, "logs_dir", None)
54 if logs_dir is not None:
55 Path(logs_dir).mkdir(parents=True, exist_ok=True)
56 (Path(logs_dir) / "completion.txt").write_text(text)

Calls

no outgoing calls