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

Function build_task_input_payload

run.py:22–36  ·  view source on GitHub ↗

Construct the initial task input, embedding attachments when available.

(
    graph_context: GraphContext,
    prompt: str,
    attachment_paths: List[str]
)

Source from the content-addressed store, hash-verified

20ensure_schema_registry_populated()
21
22def build_task_input_payload(
23 graph_context: GraphContext,
24 prompt: str,
25 attachment_paths: List[str]
26) -> Union[str, List[Message]]:
27 """Construct the initial task input, embedding attachments when available."""
28 if not attachment_paths:
29 return prompt
30
31 code_workspace = graph_context.directory / "code_workspace"
32 attachments_dir = code_workspace / "attachments"
33 attachments_dir.mkdir(parents=True, exist_ok=True)
34 store = AttachmentStore(attachments_dir)
35 builder = TaskInputBuilder(store)
36 return builder.build_from_file_paths(prompt, attachment_paths)
37
38def parse_arguments():
39 parser = argparse.ArgumentParser(description="Run ChatDev_new workflow")

Callers 1

mainFunction · 0.85

Calls 3

build_from_file_pathsMethod · 0.95
AttachmentStoreClass · 0.90
TaskInputBuilderClass · 0.90

Tested by

no test coverage detected