Skip to content
This repository was archived by the owner on May 15, 2026. It is now read-only.

Allow for a simpler way to set system instructions#149

Merged
andrewheard merged 1 commit into
mainfrom
peterfriese/systeminstructions-simplify
Apr 29, 2024
Merged

Allow for a simpler way to set system instructions#149
andrewheard merged 1 commit into
mainfrom
peterfriese/systeminstructions-simplify

Conversation

@peterfriese
Copy link
Copy Markdown
Collaborator

This change allows developers to write

model = GenerativeModel(name: "gemini-1.0-pro", apiKey: APIKey.default, systemInstruction: "Talk like a pirate")

instead of

model = GenerativeModel(name: "gemini-1.0-pro", apiKey: APIKey.default, systemInstruction: ModelContent(role: "system", parts: "Talk like a pirate"))

Signed-off-by: Peter Friese <peter@peterfriese.de>
@github-actions github-actions Bot added component:swift sdk Issue/PR related to Swift SDK status:awaiting review PR awaiting review from a maintainer labels Apr 29, 2024
Copy link
Copy Markdown
Collaborator

@andrewheard andrewheard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Peter!

@andrewheard
Copy link
Copy Markdown
Collaborator

Since this isn't a breaking change, I think it would be reasonable to do a quick 0.5.1 patch to make sure our new docs will match the latest release. So I wouldn't forget, I updated the version in #150.

@andrewheard andrewheard merged commit e195730 into main Apr 29, 2024
@andrewheard andrewheard deleted the peterfriese/systeminstructions-simplify branch April 29, 2024 19:04
@github-actions github-actions Bot removed the status:awaiting review PR awaiting review from a maintainer label Apr 29, 2024
SsomsakTH pushed a commit to SsomsakTH/generative-ai-swift that referenced this pull request Jun 21, 2024
Signed-off-by: Peter Friese <peter@peterfriese.de>
SsomsakTH pushed a commit to SsomsakTH/generative-ai-swift that referenced this pull request Jun 21, 2024
Signed-off-by: Peter Friese <peter@peterfriese.de>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

component:swift sdk Issue/PR related to Swift SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants