-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Confirm this is an issue with the Python library and not an underlying OpenAI API
- This is an issue with the Python library
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
pimlock, kolomietsdv, rfree18, PleahMaCaka, avi-nference and 1 more
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working