MCPcopy Index your code
hub / github.com/OpenBMB/ChatDev / request

Method request

utils/human_prompt.py:43–63  ·  view source on GitHub ↗
(
        self,
        *,
        node_id: str,
        task: str,
        inputs: Optional[str] = None,
        metadata: Optional[Dict[str, Any]] = None,
    )

Source from the content-addressed store, hash-verified

41 input_func: Callable[[str], str] = input
42
43 def request(
44 self,
45 *,
46 node_id: str,
47 task: str,
48 inputs: Optional[str] = None,
49 metadata: Optional[Dict[str, Any]] = None,
50 ) -> PromptResult:
51 header = ["===== HUMAN INPUT REQUIRED ====="]
52 if inputs:
53 header.append("=== Node inputs ===")
54 header.append(inputs)
55 header.append(f"=== Task for human ({node_id}) ===")
56 header.append(task)
57 header.append("=== Your response: ===")
58 prompt = "\n".join(header) + "\n"
59 response = self.input_func(prompt)
60 return PromptResult(
61 text=response,
62 blocks=[MessageBlock.text_block(response or "")],
63 )
64
65
66class HumanPromptService:

Callers

nothing calls this directly

Calls 2

PromptResultClass · 0.85
text_blockMethod · 0.80

Tested by

no test coverage detected