Skip to content

Thinking effort API - includeThoughts #222

Closed

Description

@sushraja-msft

Adding feedback for API shape on the thinking effort API
https://github.com/webmachinelearning/prompt-api/pull/217/changes

We have in this proposal

const session = await LanguageModel.create({
  thinking: {
    effort: "medium",
    includeThoughts: true,Expand commentComment on line R568Resolved
  }
});

instead I think a more natural fit would be

const session = await LanguageModel.create({
  thinkingEffort: "medium"
  expectedOutputs: [{ type: "text", languages: ["en"] }, { type: "thought" }],
});

This matches what tool-use is proposing with
expectedOutputs: [{ type: "text", languages: ["en"] }, { type: "tool-call" }]
https://github.com/webmachinelearning/prompt-api/#tool-use

the expected outputs only controls whether the thinking tokens are emitted or not in a stream, while the create options controls whether thinking is enabled and what effort should be used for this session.

Activity

  1. michaelwasserman commented on Oct 6, 2026

    @michaelwasserman
    Collaborator

    This is a great suggestion, I totally agree.
    @isaacahouma can you help update the explainer, spec, and follow up with wrt chromium impl plans?

  2. isaacahouma commented on Oct 6, 2026

    @isaacahouma
    Collaborator

    Thanks for the suggestion @sushraja-msft and @michaelwasserman! Moving to a top-level thinkingEffort option alongside expectedOutputs: [{ type: "text", languages: ["en"] }, { type: "thought" }] is much cleaner and aligns thought emission directly with how Tool Use negotiates structured { type, value } outputs via { type: "tool-call" }.

    Concretely, this gives us a consistent surface across the API:

    • LanguageModelCreateCoreOptions: thinkingEffort ("none" | "low" | "medium" | "high", default "none") controls whether reasoning is enabled and its baseline budget tier, while expectedOutputs: [{ type: "text", languages: ["en"] }, { type: "thought" }] opts the session into receiving structured LanguageModelMessageContent items ([{ type: "thought", value }, { type: "text", value }]) from prompt() and promptStreaming().
    • LanguageModelPromptOptions: thinkingEffort overrides the session's baseline effort tier for an individual prompt() or promptStreaming() call. Because structured output negotiation happens at session creation via expectedOutputs, a session created with { type: "thought" } always uses the LanguageModelMessageContent format across all turns (emitting [{ type: "thought", value }, { type: "text", value }] on thinking turns, and [{ type: "text", value }] if a specific turn is overridden to thinkingEffort: "none").
    • LanguageModel: keeps readonly attribute LanguageModelThinkingEffort thinkingEffort; and drops the separate includeThoughts boolean and LanguageModelThinkingOptions dictionary.

    I opened #224 to update the explainer (README.md) and updated https://chromestatus.com/feature/5098001721851904 too. Thinking Mode is not in the spec yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions