MCPcopy Index your code
hub / github.com/langroid/langroid / default_value

Method default_value

langroid/agent/tool_message.py:232–244  ·  view source on GitHub ↗

Returns the default value of the given field, for the message-class Args: f (str): field name Returns: Any: default value of the field, or None if not set or if the field does not exist.

(cls, f: str)

Source from the content-addressed store, hash-verified

230
231 @classmethod
232 def default_value(cls, f: str) -> Any:
233 """
234 Returns the default value of the given field, for the message-class
235 Args:
236 f (str): field name
237
238 Returns:
239 Any: default value of the field, or None if not set or if the
240 field does not exist.
241 """
242 schema = cls.model_json_schema()
243 properties = schema["properties"]
244 return properties.get(f, {}).get("default", None)
245
246 @classmethod
247 def format_instructions(cls, tool: bool = False) -> str:

Callers 15

nameMethod · 0.80
format_instructionsMethod · 0.80
llm_function_schemaMethod · 0.80
_get_tool_listMethod · 0.80
_tool_recipient_matchMethod · 0.80
get_tool_messagesMethod · 0.80
tool_validation_errorMethod · 0.80
_handle_message_finalMethod · 0.80
to_ChatDocumentMethod · 0.80
handle_tool_messageMethod · 0.80

Calls 1

getMethod · 0.80

Tested by 15

test_mcp_tool_schemasFunction · 0.64
agentFunction · 0.64
test_llm_done_toolFunction · 0.64
test_orch_toolsFunction · 0.64
test_orch_tools_asyncFunction · 0.64
test_send_toolsFunction · 0.64
test_multi_agentFunction · 0.64