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]]