MCPcopy Create free account
hub / github.com/AQ-MedAI/MedMemoryBench / assistant_function_to_tool

Function assistant_function_to_tool

methods/letta/utils.py:496–507  ·  view source on GitHub ↗
(assistant_message: dict)

Source from the content-addressed store, hash-verified

494
495
496def assistant_function_to_tool(assistant_message: dict) -> dict:
497 assert "function_call" in assistant_message
498 new_msg = copy.deepcopy(assistant_message)
499 function_call = new_msg.pop("function_call")
500 new_msg["tool_calls"] = [
501 {
502 "id": get_tool_call_id(),
503 "type": "function",
504 "function": function_call,
505 }
506 ]
507 return new_msg
508
509
510def is_optional_type(hint):

Callers

nothing calls this directly

Calls 2

get_tool_call_idFunction · 0.70
popMethod · 0.45

Tested by

no test coverage detected