langchain_core.output_parsers.openai_tools
.parse_tool_callsΒΆ
- langchain_core.output_parsers.openai_tools.parse_tool_calls(raw_tool_calls: List[dict], *, partial: bool = False, strict: bool = False, return_id: bool = True) List[Dict[str, Any]] [source]ΒΆ
Parse a list of tool calls.
- Parameters
raw_tool_calls (List[dict]) β The raw tool calls 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 calls.
- Raises
OutputParserException β If any of the tool calls are not valid JSON.
- Return type
List[Dict[str, Any]]