langchain_core.output_parsers.openai_tools
.parse_tool_callΒΆ
- langchain_core.output_parsers.openai_tools.parse_tool_call(raw_tool_call: Dict[str, Any], *, partial: bool = False, strict: bool = False, return_id: bool = True) Optional[Dict[str, Any]] [source]ΒΆ
Parse a single tool call.
- Parameters
raw_tool_call (Dict[str, Any]) β The raw tool call to parse.
partial (bool) β Whether to parse partial JSON. Default is False.
strict (bool) β Whether to allow non-JSON-compliant strings. Default is False.
return_id (bool) β Whether to return the tool call id. Default is True.
- Returns
The parsed tool call.
- Raises
OutputParserException β If the tool call is not valid JSON.
- Return type
Optional[Dict[str, Any]]