@@ -105,7 +105,10 @@ type GenerativeModel struct {
105
105
GenerationConfig
106
106
SafetySettings []* SafetySetting
107
107
Tools []* Tool
108
- ToolConfig * ToolConfig
108
+ ToolConfig * ToolConfig // configuration for tools
109
+ // SystemInstruction (also known as "system prompt") is a more forceful prompt to the model.
110
+ // The model will adhere the instructions more strongly than if they appeared in a normal prompt.
111
+ SystemInstruction * Content
109
112
}
110
113
111
114
// GenerativeModel creates a new instance of the named generative model.
@@ -165,12 +168,13 @@ func (m *GenerativeModel) generateContent(ctx context.Context, req *pb.GenerateC
165
168
166
169
func (m * GenerativeModel ) newGenerateContentRequest (contents ... * Content ) * pb.GenerateContentRequest {
167
170
return & pb.GenerateContentRequest {
168
- Model : m .fullName ,
169
- Contents : support .TransformSlice (contents , (* Content ).toProto ),
170
- SafetySettings : support .TransformSlice (m .SafetySettings , (* SafetySetting ).toProto ),
171
- Tools : support .TransformSlice (m .Tools , (* Tool ).toProto ),
172
- ToolConfig : m .ToolConfig .toProto (),
173
- GenerationConfig : m .GenerationConfig .toProto (),
171
+ Model : m .fullName ,
172
+ Contents : support .TransformSlice (contents , (* Content ).toProto ),
173
+ SafetySettings : support .TransformSlice (m .SafetySettings , (* SafetySetting ).toProto ),
174
+ Tools : support .TransformSlice (m .Tools , (* Tool ).toProto ),
175
+ ToolConfig : m .ToolConfig .toProto (),
176
+ GenerationConfig : m .GenerationConfig .toProto (),
177
+ SystemInstruction : m .SystemInstruction .toProto (),
174
178
}
175
179
}
176
180
0 commit comments