Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
This bug fix commit introduces a breaking change in 1.99.2:
657f551
Use of the previous type ChatCompletionToolParam emits an error:
error processing frame: Cannot instantiate typing.Union
Rather than break, can their be a migration path to the new ChatCompletionFunctionToolParam type?
To Reproduce
Define a tool as:
tools = [
ChatCompletionToolParam(
type="function",
function={
"name": "switch_voice",
"description": "Switch your voice only when the user asks you to",
"parameters": {
"type": "object",
"properties": {
"voice": {
"type": "string",
"description": "The voice the user wants you to use",
},
},
"required": ["voice"],
},
},
)
]
Run application using this tool definition.
Code snippets
OS
macOS
Python version
Python 3.12.8
Library version
1.99.2
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
This bug fix commit introduces a breaking change in 1.99.2:
657f551
Use of the previous type
ChatCompletionToolParamemits an error:Rather than break, can their be a migration path to the new
ChatCompletionFunctionToolParamtype?To Reproduce
Define a tool as:
Run application using this tool definition.
Code snippets
OS
macOS
Python version
Python 3.12.8
Library version
1.99.2