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

Function main

run.py:77–119  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 return parser.parse_args()
76
77def main() -> None:
78 args = parse_arguments()
79
80 if args.inspect_schema:
81 breadcrumbs = None
82 if args.schema_breadcrumbs:
83 try:
84 breadcrumbs = json.loads(args.schema_breadcrumbs)
85 except json.JSONDecodeError as exc:
86 raise SystemExit(f"Invalid --schema-breadcrumbs JSON: {exc}")
87 try:
88 schema = build_schema_response(breadcrumbs)
89 except SchemaResolutionError as exc:
90 raise SystemExit(f"Failed to resolve schema: {exc}")
91 print(json.dumps(schema, indent=2, ensure_ascii=False))
92 return
93
94 design = load_config(
95 args.path,
96 fn_module=args.fn_module,
97 )
98
99 task_prompt = input("Please enter the task prompt: ")
100
101 # Create GraphConfig and GraphContext
102 graph_config = GraphConfig.from_definition(
103 design.graph,
104 name=args.name,
105 output_root=OUTPUT_ROOT,
106 source_path=str(args.path),
107 vars=design.vars,
108 )
109 graph_context = GraphContext(config=graph_config)
110
111 task_input = build_task_input_payload(
112 graph_context,
113 task_prompt,
114 args.attachment or [],
115 )
116
117 GraphExecutor.execute_graph(graph_context, task_input)
118
119 print(graph_context.final_message())
120
121
122if __name__ == "__main__":

Callers 1

run.pyFile · 0.70

Calls 8

final_messageMethod · 0.95
build_schema_responseFunction · 0.90
load_configFunction · 0.90
GraphContextClass · 0.90
parse_argumentsFunction · 0.85
build_task_input_payloadFunction · 0.85
from_definitionMethod · 0.80
execute_graphMethod · 0.80

Tested by

no test coverage detected