Skip to content

Missing Summary Type on reasoning parameter for reasoning model calls #1487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
rezabrizi opened this issue Apr 27, 2025 · 1 comment
Closed
1 task done

Comments

@rezabrizi
Copy link

rezabrizi commented Apr 27, 2025

Confirm this is a Node library issue and not an underlying OpenAI API issue

  • This is an issue with the Node library

Describe the bug

Reasoning Summary generation by reasoning models requires the parameter summary to be enabled. However, the current sdk has generate_summary which is not the valid option. This returns a 400 error. When trying to pass summary it causes typescript to yell at you due to invalid types.

export interface Reasoning {
  /**
   * **o-series models only**
   *
   * Constrains effort on reasoning for
   * [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
   * supported values are `low`, `medium`, and `high`. Reducing reasoning effort can
   * result in faster responses and fewer tokens used on reasoning in a response.
   */
  effort?: ReasoningEffort | null;

  /**
   * **computer_use_preview only**
   *
   * A summary of the reasoning performed by the model. This can be useful for
   * debugging and understanding the model's reasoning process. One of `concise` or
   * `detailed`.
   */
  generate_summary?: 'concise' | 'detailed' | null;

To Reproduce

const stream = await openai.responses
      .stream({
        model: "o4-mini",
        input: [
          {
            role: "system",
            content: "You are helpful!",
          }
        ],
        text: {
          format: sampleSchema,
        },
        reasoning: {
          effort: "low",
//generate_summary is the invalid parameter
          generate_summary: "concise",
        },
      }).on("response.reasoning_summary_text.delta", (event) => {
        const delta = event.delta;
      });
// this is invalid because response.reasoning_summary_text.delta does not exist on the event types



// To fix I currently do: 


const stream = await openai.responses
      .stream({
        model: "o4-mini",
        input: [
          {
            role: "system",
            content: "You are helpful!",
          }
        ],
        text: {
          format: sampleSchema,
        },
        reasoning: {
          effort: "low",
          summary: "auto",
        } as any,
      }).on("response.reasoning_summary_text.delta" as any, (event: any) => {
        const delta = event.delta as string;
      });

Code snippets

OS

macOS

Node version

v18.20.4

Library version

@4.96.0

@rezabrizi rezabrizi added the bug Something isn't working label Apr 27, 2025
@RobertCraigie RobertCraigie removed the bug Something isn't working label Apr 28, 2025
@RobertCraigie
Copy link
Collaborator

Thanks for the report but it looks like generate_summary is marked as deprecated and that summary does exist? Are you sure you're on the latest version?

@RobertCraigie RobertCraigie closed this as not planned Won't fix, can't repro, duplicate, stale Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants