@@ -55,7 +55,8 @@ public final class GenerativeModel {
55
55
/// - safetySettings: A value describing what types of harmful content your model should allow.
56
56
/// - tools: A list of ``Tool`` objects that the model may use to generate the next response.
57
57
/// - systemInstruction: Instructions that direct the model to behave a certain way; currently
58
- /// only text content is supported, e.g., "You are a cat. Your name is Neko."
58
+ /// only text content is supported, e.g.,
59
+ /// `ModelContent(role: "system", parts: "You are a cat. Your name is Neko.")`.
59
60
/// - toolConfig: Tool configuration for any `Tool` specified in the request.
60
61
/// - requestOptions Configuration parameters for sending requests to the backend.
61
62
public convenience init ( name: String ,
@@ -64,7 +65,7 @@ public final class GenerativeModel {
64
65
safetySettings: [ SafetySetting ] ? = nil ,
65
66
tools: [ Tool ] ? = nil ,
66
67
toolConfig: ToolConfig ? = nil ,
67
- systemInstruction: String ... ,
68
+ systemInstruction: ModelContent ? = nil ,
68
69
requestOptions: RequestOptions = RequestOptions ( ) ) {
69
70
self . init (
70
71
name: name,
@@ -73,10 +74,7 @@ public final class GenerativeModel {
73
74
safetySettings: safetySettings,
74
75
tools: tools,
75
76
toolConfig: toolConfig,
76
- systemInstruction: ModelContent (
77
- role: " system " ,
78
- parts: systemInstruction. map { ModelContent . Part. text ( $0) }
79
- ) ,
77
+ systemInstruction: systemInstruction,
80
78
requestOptions: requestOptions,
81
79
urlSession: . shared
82
80
)
@@ -92,8 +90,7 @@ public final class GenerativeModel {
92
90
/// - safetySettings: A value describing what types of harmful content your model should allow.
93
91
/// - tools: A list of ``Tool`` objects that the model may use to generate the next response.
94
92
/// - systemInstruction: Instructions that direct the model to behave a certain way; currently
95
- /// only text content is supported, e.g.,
96
- /// `ModelContent(role: "system", parts: "You are a cat. Your name is Neko.")`.
93
+ /// only text content is supported, e.g., "You are a cat. Your name is Neko."
97
94
/// - toolConfig: Tool configuration for any `Tool` specified in the request.
98
95
/// - requestOptions Configuration parameters for sending requests to the backend.
99
96
public convenience init ( name: String ,
@@ -102,7 +99,7 @@ public final class GenerativeModel {
102
99
safetySettings: [ SafetySetting ] ? = nil ,
103
100
tools: [ Tool ] ? = nil ,
104
101
toolConfig: ToolConfig ? = nil ,
105
- systemInstruction: ModelContent ? = nil ,
102
+ systemInstruction: String ... ,
106
103
requestOptions: RequestOptions = RequestOptions ( ) ) {
107
104
self . init (
108
105
name: name,
@@ -111,7 +108,10 @@ public final class GenerativeModel {
111
108
safetySettings: safetySettings,
112
109
tools: tools,
113
110
toolConfig: toolConfig,
114
- systemInstruction: systemInstruction,
111
+ systemInstruction: ModelContent (
112
+ role: " system " ,
113
+ parts: systemInstruction. map { ModelContent . Part. text ( $0) }
114
+ ) ,
115
115
requestOptions: requestOptions,
116
116
urlSession: . shared
117
117
)
0 commit comments