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

Function _build_task_input

runtime/sdk.py:47–60  ·  view source on GitHub ↗
(
    graph_context: GraphContext,
    prompt: str,
    attachments: Sequence[Union[str, Path]],
)

Source from the content-addressed store, hash-verified

45
46
47def _build_task_input(
48 graph_context: GraphContext,
49 prompt: str,
50 attachments: Sequence[Union[str, Path]],
51) -> Union[str, list[Message]]:
52 if not attachments:
53 return prompt
54
55 attachments_dir = graph_context.directory / "code_workspace" / "attachments"
56 attachments_dir.mkdir(parents=True, exist_ok=True)
57 store = AttachmentStore(attachments_dir)
58 builder = TaskInputBuilder(store)
59 normalized_paths = [str(Path(path).expanduser()) for path in attachments]
60 return builder.build_from_file_paths(prompt, normalized_paths)
61
62
63def _resolve_yaml_path(yaml_file: Union[str, Path]) -> Path:

Callers 1

run_workflowFunction · 0.70

Calls 3

build_from_file_pathsMethod · 0.95
AttachmentStoreClass · 0.90
TaskInputBuilderClass · 0.90

Tested by

no test coverage detected