30 ChatMessage,
31 ChatMessageChunk,
32▶ FunctionMessageChunk,
33 HumanMessage,
34 HumanMessageChunk,
· · ·
48from langchain_core.tools import BaseTool
49from langchain_core.utils import get_pydantic_field_names, secret_from_env
50▶from langchain_core.utils.function_calling import (
51 convert_to_json_schema,
52 convert_to_openai_tool,
· · ·
163
164def _is_builtin_tool(tool: dict) -> bool:
165▶ """Return True if `tool` is a Responses-API built-in (non-`function`) tool.
166
167 Perplexity's Agent API ships built-in tools (e.g. `web_search`,
· · ·
168 `code_interpreter`) that are identified by a `type` value other than
169▶ `"function"`. Chat Completions only accepts function tools, so any tool
170 failing this check forces the Responses route.
171 """
· · ·
172▶ return "type" in tool and tool["type"] != "function"
173
174
+ 46 more matches in this file