MCPcopy
hub / github.com/langroid/langroid / from_dict

Method from_dict

langroid/language_models/base.py:184–196  ·  view source on GitHub ↗

Initialize from dictionary. Args: d: dictionary containing fields to initialize

(message: Dict[str, Any])

Source from the content-addressed store, hash-verified

182
183 @staticmethod
184 def from_dict(message: Dict[str, Any]) -> "OpenAIToolCall":
185 """
186 Initialize from dictionary.
187 Args:
188 d: dictionary containing fields to initialize
189 """
190 id = message["id"]
191 type = message["type"]
192 function = LLMFunctionCall.from_dict(message["function"])
193 extra_content = message.get("extra_content")
194 return OpenAIToolCall(
195 id=id, type=type, function=function, extra_content=extra_content
196 )
197
198 def __str__(self) -> str:
199 if self.function is None:

Calls 2

OpenAIToolCallClass · 0.85
getMethod · 0.80

Tested by

no test coverage detected