convert_python_function_to_openai_function#
- langchain_core.utils.function_calling.convert_python_function_to_openai_function(function: Callable) FunctionDescription [source]#
Deprecated since version 0.1.16: Use
langchain_core.utils.function_calling.convert_to_openai_function()
instead.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: