MCPcopy Create free account
hub / github.com/HKUDS/AutoAgent / make_tool_message

Function make_tool_message

autoagent/util.py:461–475  ·  view source on GitHub ↗
(tools: Callable, args: dict, tool_content: str)

Source from the content-addressed store, hash-verified

459
460
461def make_tool_message(tools: Callable, args: dict, tool_content: str) -> List[Dict]:
462 tool_calls = [
463 {
464 "type": "function",
465 "function": {
466 "name": tools.__name__,
467 "arguments": json.dumps(args)
468 },
469 "id": str(uuid.uuid4()).replace('-', '')[:9]
470 }
471 ]
472 return [
473 {'role': 'assistant', 'tool_calls': tool_calls},
474 {'role': 'tool', 'content': tool_content, 'name': tools.__name__, 'tool_call_id': tool_calls[0]['id']}
475 ]
476def make_message(role: str, content: str):
477 return [
478 {'role': role, 'content': content}

Callers 1

examplesFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected