{"record":{"id":"7d95f1a4c1a18fc1","repo":"run-llama/llama_index","slug":"get-tool-calls-from-response-is-not-supported-by-d","errorCode":null,"errorMessage":"get_tool_calls_from_response is not supported by default.","messagePattern":"get_tool_calls_from_response is not supported by default\\.","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"llama-index-core/llama_index/core/llms/function_calling.py","lineNumber":198,"sourceCode":"\n    def _validate_chat_with_tools_response(\n        self,\n        response: ChatResponse,\n        tools: Sequence[\"BaseTool\"],\n        allow_parallel_tool_calls: bool = False,\n        **kwargs: Any,\n    ) -> ChatResponse:\n        \"\"\"Validate the response from chat_with_tools.\"\"\"\n        return response\n\n    def get_tool_calls_from_response(\n        self,\n        response: ChatResponse,\n        error_on_no_tool_call: bool = True,\n        **kwargs: Any,\n    ) -> List[ToolSelection]:\n        \"\"\"Predict and call the tool.\"\"\"\n        raise NotImplementedError(\n            \"get_tool_calls_from_response is not supported by default.\"\n        )\n\n    def predict_and_call(\n        self,\n        tools: Sequence[\"BaseTool\"],\n        user_msg: Optional[Union[str, ChatMessage]] = None,\n        chat_history: Optional[List[ChatMessage]] = None,\n        verbose: bool = False,\n        allow_parallel_tool_calls: bool = False,\n        error_on_no_tool_call: bool = True,\n        error_on_tool_error: bool = False,\n        **kwargs: Any,\n    ) -> \"AgentChatResponse\":\n        \"\"\"Predict and call the tool.\"\"\"\n        from llama_index.core.chat_engine.types import AgentChatResponse\n        from llama_index.core.tools.calling import (\n            call_tool_with_selection,","sourceCodeStart":180,"sourceCodeEnd":216,"githubUrl":"https://github.com/run-llama/llama_index/blob/afd0fef371831f9bda13e5af7167cf4e981278ab/llama-index-core/llama_index/core/llms/function_calling.py#L180-L216","documentation":"NotImplementedError from the base FunctionCallingLLM.get_tool_calls_from_response(): the base class cannot parse tool calls out of a raw ChatResponse because the format is provider-specific. Concrete function-calling LLMs (OpenAI, Anthropic, etc.) override it; hitting this means the LLM class you are using inherited the stub.","triggerScenarios":"Calling llm.get_tool_calls_from_response(response) or llm.chat_with_tools(...) / agent code paths that invoke it on an LLM whose class inherits from FunctionCallingLLM but does not implement the parser — e.g. a custom LLM wrapper marked as function-calling, or a base-class instantiation used directly.","commonSituations":"Custom LLM subclasses that set is_function_calling_model=True (or subclass FunctionCallingLLM) for structured-output support but never implement tool-call parsing; calling the abstract base during testing; providers whose integration only partially implements the interface.","solutions":["Use a fully implemented function-calling LLM (OpenAILLM, Anthropic, etc.) for tool-calling flows.","If subclassing FunctionCallingLLM, implement get_tool_calls_from_response() to extract ToolSelection objects from response.additional_kwargs / tool_calls.","Do not advertise function-calling support for wrappers that cannot parse tool calls."],"exampleFix":"# before\nclass MyLLM(FunctionCallingLLM):  # missing get_tool_calls_from_response\n    ...\nresp = my_llm.chat_with_tools(tools, user_msg='hi')  # raises NotImplementedError\n\n# after\nclass MyLLM(FunctionCallingLLM):\n    def get_tool_calls_from_response(self, response, error_on_no_tool_call=True, **kwargs):\n        tool_calls = response.message.additional_kwargs.get('tool_calls', [])\n        selections = [ToolSelection.from_openai_tool_call(tc) for tc in tool_calls]\n        if not selections and error_on_no_tool_call:\n            raise ValueError('No tool call found')\n        return selections","handlingStrategy":"type-guard","validationCode":"import inspect\nfrom llama_index.core.llms.function_calling import FunctionCallingLLM\n\ndef supports_tool_parsing(llm) -> bool:\n    return (\n        isinstance(llm, FunctionCallingLLM)\n        and FunctionCallingLLM.get_tool_calls_from_response\n        is not type(llm).get_tool_calls_from_response\n    )","typeGuard":"import inspect\nfrom llama_index.core.llms.function_calling import FunctionCallingLLM\n\ndef supports_tool_parsing(llm: FunctionCallingLLM) -> bool:\n    return type(llm).get_tool_calls_from_response is not FunctionCallingLLM.get_tool_calls_from_response","tryCatchPattern":"try:\n    calls = llm.get_tool_calls_from_response(resp)\nexcept NotImplementedError:\n    raise NotImplementedError(\n        f'{type(llm).__name__} does not implement tool-call parsing; use an OpenAI/Anthropic-compatible LLM'\n    )","preventionTips":["Use a provider LLM with real function calling for tool flows","Implement get_tool_calls_from_response() in custom FunctionCallingLLM subclasses","Do not mark wrappers as function-calling unless they can parse tool calls"],"tags":["llm","function-calling","tools","not-implemented"],"backgroundTag":null,"analyzedSha":"afd0fef371831f9bda13e5af7167cf4e981278ab","analyzedAt":"2026-08-15T05:42:58.429Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}