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

Class ToolCallPayload

entity/messages.py:169–187  ·  view source on GitHub ↗

Unified representation of a tool call request.

Source from the content-addressed store, hash-verified

167
168@dataclass
169class ToolCallPayload:
170 """Unified representation of a tool call request."""
171
172 id: str
173 function_name: str
174 arguments: str
175 type: str = "function"
176 metadata: Dict[str, Any] = field(default_factory=dict)
177
178 def to_openai_dict(self) -> Dict[str, Any]:
179 """Convert to OpenAI-compatible schema."""
180 return {
181 "id": self.id,
182 "type": self.type,
183 "function": {
184 "name": self.function_name,
185 "arguments": self.arguments,
186 },
187 }
188
189
190@dataclass

Callers 4

_parse_tool_callMethod · 0.90
from_dictMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected