Gpt-4o-search-preview gives unrelated data when using structured outputs

Are structured outputs even supported when using gpt-4o-search-preview?

It gives completely unrelated search to my “system message”, but as soon as I remove the json_schema, it works fine.

If it isn’t supported, it doesn’t seem to be written anywhere in the docs. It should also return an error when using json_schema if it’s not supported :grimacing:

1 Like

Works for me. The last citation was published three days ago.

The remainder of the JSON in the screenshot there is simply structured output that the AI is forced to fill in, a hallucination playground.

Consider the searching to be out of your control and directives, implemented by an outside source that injects the knowledge, with obfuscated technology. This is a chat completions model without a tool iterator. You get billed “search” for every usage, even “hi”. Especially important is instructions that basically overrule everything about how the search results should be presented, likely your primary issue.

1 Like

Well what if you ask it to give you the 5 most relevant links for topic X?

Your example doesn’t show unrelated search results/annotations, because you have not really specified a topic.

I understand that the searching is out of my control, but shouldn’t it be at least remotely close to what I’m asking it to search??

1 Like

You say: gave results unrelated to your system message?

The user input is what is important and what is being answered:

“When was the 2025 version of The Naked Gun movie initially conceived and how did it proceed into production?”

Output into a random semi-applicable JSON schema I had the AI schema-maker produce:

{
  "response_to_user": "The development of the 2025 reboot of \"The Naked Gun\" has undergone several phases:\n\n- **December 2013**: Paramount Pictures announced plans for a reboot with Ed Helms cast as Frank Drebin, and a script by Thomas Lennon and R. Ben Garant. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **January 2014**: The project was intended as a sequel, with Helms portraying a character introducing himself as \"Frank Drebin, no relation.\" ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **March 2015**: David Zucker declined involvement, expressing concerns about the comedic style differing from the original films. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **August 2015**: Helms confirmed ongoing script development, acknowledging the need for a fresh approach to appeal to modern audiences. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **March 2017**: Zucker and Pat Proft reworked the script to feature Frank Drebin's son. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **January 2021**: Seth MacFarlane joined the project, expressing interest in casting Liam Neeson as Frank Drebin Jr. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **June 2021**: Neeson confirmed discussions with MacFarlane and Paramount Pictures about starring in the reboot. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **February 2022**: Neeson reiterated that Paramount was still courting him for the lead role. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **October 2022**: The film was officially greenlit with Neeson as Frank Drebin Jr., Akiva Schaffer directing, and a script by Dan Gregor and Doug Mand. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **April 2024**: Pamela Anderson joined the cast. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **May 2024**: Paul Walter Hauser, Kevin Durand, Danny Huston, Liza Koshy, Cody Rhodes, CCH Pounder, and Busta Rhymes were added to the cast. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **May 6, 2024**: Principal photography began in Atlanta under the working title \"Law of Toughness\" and concluded on June 28, 2024. ([en.wikipedia.org](https://en.wikipedia.org/wiki/The_Naked_Gun_%282025_film%29?utm_source=openai))\n\n- **April 4, 2025**: The first trailer was released, showcasing Liam Neeson in the lead role. ([gamesradar.com](https://www.gamesradar.com/entertainment/live-action-movies/the-naked-gun-liam-neeson-first-trailer/?utm_source=openai))\n\n- **August 1, 2025**: The film is scheduled for theatrical release. ([gamesradar.com](https://www.gamesradar.com/entertainment/live-action-movies/the-naked-gun-liam-neeson-first-trailer/?utm_source=openai))\n\nThis timeline highlights the project's evolution from initial conception to its upcoming release.",
  "search_query_strings_sent": [
    "The Naked Gun 2025 movie development timeline"
  ],
  "search_result_count_per_query": [
    5
  ],
  "top_cited_source": "turn0search14"
}

It is user input being answered. The pattern of “chat” API model usage is not to put commands into the system message, but to put behaviors.

image

A stronger behavior comes about from “YOU NEVER RECITE WEB RESULTS” ect. from the search injection.

JSON schema is also a behavior. Also part of a system message. If the fields don’t align with what the AI is instructed, it can’t perform well.

Try starting with a “message_to_user”, along with other JSON keys easy to answer like “chat_topic”. Then you can build from there to see where you can go with the search model and its single purpose of being expensive Google.