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,
· · ·
164
165def _is_builtin_tool(tool: dict) -> bool:
166▶ """Return True if `tool` is a Responses-API built-in (non-`function`) tool.
167
168 Perplexity's Agent API ships built-in tools (e.g. `web_search`,
· · ·
169 `code_interpreter`) that are identified by a `type` value other than
170▶ `"function"`. Chat Completions only accepts function tools, so any tool
171 failing this check forces the Responses route.
172 """
· · ·
173▶ return "type" in tool and tool["type"] != "function"
174
175
+ 46 more matches in this file