convert_python_function_to_openai_function#
- langchain_core.utils.function_calling.convert_python_function_to_openai_function(function: Callable) FunctionDescription #
Deprecated since version 0.1.16: Use
convert_to_openai_function()
instead. It will not be removed until langchain-core==1.0.Convert a Python function to an OpenAI function-calling API compatible dict.
- Assumes the Python function has type hints and a docstring with a description. If
the docstring has Google Python style argument descriptions, these will be included as well.
- Parameters:
function (Callable) – The Python function to convert.
- Returns:
The OpenAI function description.
- Return type: