Convert a raw function/class to an OpenAI function.
convert_to_openai_function(
function: Mapping[str, Any] | type | Callable | BaseTool,
*,
strict: bool | None = None
) -> dict[str, Any]description and parameters keys are now optional. Only name is
required and guaranteed to be part of the output.
| Name | Type | Description |
|---|---|---|
function* | Mapping[str, Any] | type | Callable | BaseTool | A dictionary, Pydantic If a dictionary is passed in, it is assumed to already be a valid OpenAI
function, a JSON schema with top-level |
strict | bool | None | Default: NoneIf If |