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

Function _build_task_input

server/routes/execute_sync.py:53–66  ·  view source on GitHub ↗
(
    graph_context: GraphContext,
    prompt: str,
    attachments: Sequence[Union[str, Path]],
)

Source from the content-addressed store, hash-verified

51
52
53def _build_task_input(
54 graph_context: GraphContext,
55 prompt: str,
56 attachments: Sequence[Union[str, Path]],
57) -> Union[str, list[Message]]:
58 if not attachments:
59 return prompt
60
61 attachments_dir = graph_context.directory / "code_workspace" / "attachments"
62 attachments_dir.mkdir(parents=True, exist_ok=True)
63 store = AttachmentStore(attachments_dir)
64 builder = TaskInputBuilder(store)
65 normalized_paths = [str(Path(path).expanduser()) for path in attachments]
66 return builder.build_from_file_paths(prompt, normalized_paths)
67
68
69def _run_workflow_with_logger(

Callers 1

Calls 3

build_from_file_pathsMethod · 0.95
AttachmentStoreClass · 0.90
TaskInputBuilderClass · 0.90

Tested by

no test coverage detected