r"""Generates a schema dict for an OpenAI function based on its signature. This function is deprecated and will be replaced by :obj:`get_openai_tool_schema()` in future versions. It parses the function's parameters and docstring to construct a JSON schema-like dictionary. Args:
(func: Callable)
| 68 | |
| 69 | |
| 70 | def get_openai_function_schema(func: Callable) -> Dict[str, Any]: |
| 71 | r"""Generates a schema dict for an OpenAI function based on its signature. |
| 72 | |
| 73 | This function is deprecated and will be replaced by |
| 74 | :obj:`get_openai_tool_schema()` in future versions. It parses the |
| 75 | function's parameters and docstring to construct a JSON schema-like |
| 76 | dictionary. |
| 77 | |
| 78 | Args: |
| 79 | func (Callable): The OpenAI function to generate the schema for. |
| 80 | |
| 81 | Returns: |
| 82 | Dict[str, Any]: A dictionary representing the JSON schema of the |
| 83 | function, including its name, description, and parameter |
| 84 | specifications. |
| 85 | """ |
| 86 | openai_function_schema = get_openai_tool_schema(func)["function"] |
| 87 | return openai_function_schema |
| 88 | |
| 89 | |
| 90 | def get_openai_tool_schema(func: Callable) -> Dict[str, Any]: |
nothing calls this directly
no test coverage detected