Skip to content

A self-improving RLM agent for coding workflows and long-running autonomous tasks.

Rust

fix(google): send systemInstruction as a Content object (#3737)

Seth Kartenfce76223036e
diff --git a/crates/pa-ai/src/providers/google.rs b/crates/pa-ai/src/providers/google.rs
index 904cce4e93..ea36c1d2ec 100644
--- a/crates/pa-ai/src/providers/google.rs
+++ b/crates/pa-ai/src/providers/google.rs
@@ -174,7 +174,7 @@ fn build_params(model: &Model, context: &Context, options: &GoogleOptions) -> Va
if let Some(system_prompt) = &context.system_prompt {
body.insert(
"systemInstruction".into(),
- json!(sanitize_surrogates(system_prompt)),
+ json!({ "parts": [{ "text": sanitize_surrogates(system_prompt) }] }),
);
}
if let Some(tools) = &context.tools {
diff --git a/crates/pa-ai/src/providers/google_vertex.rs b/crates/pa-ai/src/providers/google_vertex.rs
index f4d8a8181f..392cbe89a7 100644
--- a/crates/pa-ai/src/providers/google_vertex.rs
+++ b/crates/pa-ai/src/providers/google_vertex.rs
@@ -236,7 +236,7 @@ fn build_params(model: &Model, context: &Context, options: &GoogleVertexOptions)
if let Some(system_prompt) = &context.system_prompt {
body.insert(
"systemInstruction".into(),
- json!(sanitize_surrogates(system_prompt)),
+ json!({ "parts": [{ "text": sanitize_surrogates(system_prompt) }] }),
);
}
if let Some(tools) = &context.tools {