Skip to content

JSON_O1 Mode is outdated #1740

@Pringled

Description

@Pringled

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions