diff --git a/pkg/lmcli/provider/google/google.go b/pkg/lmcli/provider/google/google.go index 51ca5e0..27026ec 100644 --- a/pkg/lmcli/provider/google/google.go +++ b/pkg/lmcli/provider/google/google.go @@ -158,8 +158,7 @@ func createGenerateContentRequest( } request := &GenerateContentRequest{ - Contents: requestContents, - SystemInstructions: system, + Contents: requestContents, GenerationConfig: &GenerationConfig{ MaxOutputTokens: ¶ms.MaxTokens, Temperature: ¶ms.Temperature, @@ -167,6 +166,16 @@ func createGenerateContentRequest( }, } + if system != "" { + request.SystemInstruction = Content{ + Parts: []ContentPart{ + { + Text: system, + }, + }, + } + } + if len(params.ToolBag) > 0 { request.Tools = convertTools(params.ToolBag) } diff --git a/pkg/lmcli/provider/google/types.go b/pkg/lmcli/provider/google/types.go index 1d2eb30..2e2bed4 100644 --- a/pkg/lmcli/provider/google/types.go +++ b/pkg/lmcli/provider/google/types.go @@ -34,10 +34,10 @@ type GenerationConfig struct { } type GenerateContentRequest struct { - Contents []Content `json:"contents"` - Tools []Tool `json:"tools,omitempty"` - SystemInstructions string `json:"systemInstructions,omitempty"` - GenerationConfig *GenerationConfig `json:"generationConfig,omitempty"` + Contents []Content `json:"contents"` + Tools []Tool `json:"tools,omitempty"` + SystemInstruction *Content `json:"systemInstruction,omitempty"` + GenerationConfig *GenerationConfig `json:"generationConfig,omitempty"` } type Candidate struct {