docs(dart/models): use new top-level system parameter for system prompts#281
Open
chrisraygill wants to merge 1 commit into
Open
docs(dart/models): use new top-level system parameter for system prompts#281chrisraygill wants to merge 1 commit into
system parameter for system prompts#281chrisraygill wants to merge 1 commit into
Conversation
…ompts Replaces the GeminiOptions.systemInstruction workaround with the new top-level `system` parameter added in genkit-ai/genkit-dart#289, which matches the JS and Go SDK surface.
5 tasks
Contributor
There was a problem hiding this comment.
Code Review
This pull request updates the Dart documentation in models.mdx to show how to provide a system prompt using the direct system parameter instead of configuring it through GeminiOptions. There are no review comments to address, and the changes look correct.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bug fix. The Dart variant of the Models / generating content docs previously showed
config: GeminiOptions(systemInstruction: ...)as the way to set a system prompt. That is a Gemini-specific config option, not the framework-level way to specify a system prompt — it doesn't work with non-Gemini models and bypasses Genkit's role-based message system. The snippet was incorrect for a section meant to document the cross-modelai.generate()API.This PR replaces it with the new top-level
systemparameter onai.generate(), which matches the JS and Go SDK surface.Depends on
genkit-ai/genkit-dart#289 — adds the
systemparameter toGenkit.generate,Genkit.generateStream,lite.generate,lite.generateStream, andgenerateHelper. This docs change should land after that PR ships in a release that the docs target.Before (incorrect)
After
Test plan
pnpm generate-language-pagesregeneratessrc/content/docs/docs/dart/models.mdxwith the new snippet (verified locally; that path is gitignored).