Skip to content

Rename systemPrompt to systemInstruction? Deprecate in favor of initialPrompts? #103

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
michaelwasserman opened this issue Apr 18, 2025 · 1 comment · Fixed by #106
Closed

Comments

@michaelwasserman
Copy link

WDYT about https://crbug.com/381974893 to rename systemPrompt to systemInstruction for alignment with existing lingo?

Also, should this DOMString systemPrompt; member of dictionary LanguageModelCreateOptions be converted to a LanguageModelMessage type (ideally a union of LanguageModelMessage and LanguageModelMessageShorthand) to support other modalities?

Going a step further, should we just remove this member, since it's a less-capable shorthand for a role: "system" + type: "text" entry in initialPrompts?

LanguageModel.create({ systemPrompt: "Pretend to be an eloquent hamster." });

is equivalent to:

LanguageModel.create({ initialPrompts: [{ role: "system", content: "Pretend to be an eloquent hamster." }]});

and using both raises an exception.

@domenic
Copy link
Collaborator

domenic commented Apr 21, 2025

I'm a bit hesitant to use the "system instruction" naming as it's uncommon. As far as I and o3 can tell only, Google uses it in APIs. (One more result in addition to the ones o3 mentions: the Vercel AI SDK uses system in the API and "system prompt" in the docs, like Claude does.)

@KenjiBaheux found an example of a Google API user being confused by this.

In my experience lurking in the community, it's also very common to talk about "system prompts". E.g. look at the volume and topicality of this x.com search for "system prompt" vs. this one for "system instruction".

I think you might be right that it's simplest to just remove the shortcut. It's a bit more verbose, but that sidesteps the naming issue, and removes the special-casing we have to do to prohibit using both. And it gets developers used to the full power of the longhand syntax earlier, which is good because it's more standard across the ecosystem.

domenic added a commit that referenced this issue Apr 24, 2025
Just doing the { role: "system", content: ... } version inside initialPrompts fits better with established APIs, and avoids any potential confusion by having both systemPrompt and initialPrompts.

Closes #103.
domenic added a commit that referenced this issue Apr 24, 2025
Just doing the { role: "system", content: ... } version inside initialPrompts fits better with established APIs, and avoids any potential confusion by having both systemPrompt and initialPrompts.

Closes #103.
domenic added a commit that referenced this issue Apr 24, 2025
Just doing the { role: "system", content: ... } version inside initialPrompts fits better with established APIs, and avoids any potential confusion by having both systemPrompt and initialPrompts.

Closes #103.
domenic added a commit that referenced this issue Apr 24, 2025
Just doing the { role: "system", content: ... } version inside initialPrompts fits better with established APIs, and avoids any potential confusion by having both systemPrompt and initialPrompts.

Closes #103.
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

Successfully merging a pull request may close this issue.

2 participants