gemini: Pass system prompt as system instructions (#28793)
https://ai.google.dev/gemini-api/docs/text-generation#system-instructions Release Notes: - agent: Improve performance of Gemini models
This commit is contained in:
parent
c381a500f8
commit
c7e80c80c6
2 changed files with 62 additions and 36 deletions
|
@ -125,6 +125,7 @@ pub struct GenerateContentRequest {
|
|||
#[serde(default, skip_serializing_if = "String::is_empty")]
|
||||
pub model: String,
|
||||
pub contents: Vec<Content>,
|
||||
pub system_instructions: Option<SystemInstructions>,
|
||||
pub generation_config: Option<GenerationConfig>,
|
||||
pub safety_settings: Option<Vec<SafetySetting>>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
@ -159,6 +160,12 @@ pub struct Content {
|
|||
pub role: Role,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub struct SystemInstructions {
|
||||
pub parts: Vec<Part>,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Deserialize, Serialize)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
pub enum Role {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue