Base class for server-side built-in tools.
Inherits from :class:dict so instances can be passed directly to
model.bind_tools() without additional conversion. Subclasses build
the underlying :mod:openai.types.responses TypedDict and pass it to
super().__init__(**sdk_typed_dict) so the dict payload always matches
the OpenAI SDK schema.
Some tools require extra HTTP headers to be sent with every inference API
request. Subclasses that need this should set self._request_headers
(a plain :class:dict) in their __init__. The
:attr:request_headers property exposes these headers to bind_tools
implementations in the model classes, which merge and forward them to the
underlying API client.
Example ā defining a custom built-in tool::
class MyTool(BuiltinTool):
def __init__(self, option: str = "default") -> None:
super().__init__(type="my_tool", option=option)