@@ -24,12 +24,14 @@ class GenerateContentStreamRequest implements JsonSerializable, RequestInterface
2424 * @param Content[] $contents
2525 * @param SafetySetting[] $safetySettings
2626 * @param GenerationConfig|null $generationConfig
27+ * @param ?Content $systemInstruction
2728 */
2829 public function __construct (
2930 public readonly ModelName |string $ modelName ,
3031 public readonly array $ contents ,
3132 public readonly array $ safetySettings = [],
3233 public readonly ?GenerationConfig $ generationConfig = null ,
34+ public readonly ?Content $ systemInstruction = null ,
3335 ) {
3436 $ this ->ensureArrayOfType ($ this ->contents , Content::class);
3537 $ this ->ensureArrayOfType ($ this ->safetySettings , SafetySetting::class);
@@ -56,6 +58,7 @@ public function getHttpPayload(): string
5658 * contents: Content[],
5759 * safetySettings?: SafetySetting[],
5860 * generationConfig?: GenerationConfig,
61+ * systemInstruction?: Content,
5962 * }
6063 */
6164 public function jsonSerialize (): array
@@ -73,6 +76,10 @@ public function jsonSerialize(): array
7376 $ arr ['generationConfig ' ] = $ this ->generationConfig ;
7477 }
7578
79+ if ($ this ->systemInstruction ) {
80+ $ arr ['systemInstruction ' ] = $ this ->systemInstruction ;
81+ }
82+
7683 return $ arr ;
7784 }
7885
0 commit comments