MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / _serialize_tool_calls

Function _serialize_tool_calls

src/harness/agentic_loop/loop.py:55–67  ·  view source on GitHub ↗

Convert LiteLLM tool_calls to OpenAI message format.

(tool_calls)

Source from the content-addressed store, hash-verified

53
54
55def _serialize_tool_calls(tool_calls) -> list[dict]:
56 """Convert LiteLLM tool_calls to OpenAI message format."""
57 return [
58 {
59 "id": tc.id,
60 "type": "function",
61 "function": {
62 "name": tc.function.name,
63 "arguments": tc.function.arguments,
64 },
65 }
66 for tc in tool_calls
67 ]
68
69
70def _format_mcp_result(tool_name: str, raw: Any) -> str:

Callers 1

_inner_loopMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected