-
-
Notifications
You must be signed in to change notification settings - Fork 827
Description
First of all, thanks for making this great library! While exploring the functionality, I encountered a bug.
What Model are you using?
- o1
Describe the bug
The JSON_O1 mode seems to be specifically designed as a workaround for the fact that o1 cannot handle system messages, streaming, and function calling. However, all of these features are now supported, which makes the JSON_O1 mode outdated and a bit confusing to use. See https://platform.openai.com/docs/models/o1 for an overview that states that o1 supports both streaming and function calling.
For system messages, the following example works:
from openai import OpenAI
client = OpenAI()
response = client.chat.completions.create(
model="o1",
messages=[
{"role": "system", "content": "You are a helpful assistant who talks like a pirate."},
{"role": "user", "content": "What is the capital of France?"},
],
)
Which outputs "'Arrr, me heartie! The grand capital o’ France be Paris, the fair city o’ lights!'", clearly showing that the system message is used.
Proposal
Since deprecating the JSON_O1 mode might break functionality for users, I think simply calling handle_json_modes
in future versions when JSON_O1 mode is used (and handle_json_o1
is called) would be the best solution, in combination with perhaps a warning message. If you agree, I'd be happy to submit a PR for this.