Closed yufang67 closed 1 week ago
Based on Function calling with structured outputs in this page https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/structured-outputs?tabs=python-secure I use client.chat.completions.create instead of client.beta.chat.completions.parse Its resolved.
Confirm this is an issue with the Python library and not an underlying OpenAI API
Describe the bug
We use multiprocessing to handle the calls. It was working with client.chat.completions.create. Currently, we are trying client.beta.chat.completions.parse with response_format, i got error:
Traceback (most recent call last): File "/anaconda/lib/python3.10/multiprocessing/queues.py", line 244, in _feed obj = _ForkingPickler.dumps(obj) File "/anaconda/lib/python3.10/multiprocessing/reduction.py", line 51, in dumps cls(buf, protocol).dump(obj) _pickle.PicklingError: Can't pickle <class 'openai.types.chat.parsed_chat_completion.ParsedChatCompletion[CalendarEvent]'>: attribute lookup ParsedChatCompletion[CalendarEvent] on openai.types.chat.parsed_chat_completion failed
anyone can help ?
Thanks
To Reproduce
Code snippets
No response
OS
linux
Python version
py3.10
Library version
openai 1.51.0