google-cloud-go icon indicating copy to clipboard operation
google-cloud-go copied to clipboard

feat(vertexai/genai): add SystemInstruction

Open jba opened this issue 1 year ago • 3 comments

Expose GenerateContentRequest.SystemInstruction.

As usual, put it on the Model, and use the Model field to construct each request.

jba avatar Apr 09 '24 21:04 jba

Example forthcoming.

jba avatar Apr 15 '24 11:04 jba

I added a test and an example that shows various config options. But I'm marking this a draft because the feature doesn't seem to be implemented.

jba avatar Apr 15 '24 12:04 jba

But I'm marking this a draft because the feature doesn't seem to be implemented.

The Python sample for system instructions with Gemini 1.5 Pro is working for me. I'll see if I can get similar results with the Go sdk.

Deleplace avatar Apr 26 '24 15:04 Deleplace

I'm getting compile errors at example_test.go, @jba can you PTAL?

Deleplace avatar Apr 29 '24 14:04 Deleplace

I'm getting compile errors at example_test.go, @jba can you PTAL?

Is it a vet error? What does it say?

eliben avatar Apr 29 '24 16:04 eliben

I'm getting compile errors at example_test.go, @jba can you PTAL?

Is it a vet error? What does it say?

% go test     
# cloud.google.com/go/vertexai/genai_test [cloud.google.com/go/vertexai/genai.test]
./example_test.go:58:38: undefined: option
./example_test.go:58:38: not enough arguments in call to genai.NewClient
	have (context.Context, unknown type)
	want (context.Context, string, string, ...option.ClientOption)
./example_test.go:58:56: undefined: os
FAIL	cloud.google.com/go/vertexai/genai [build failed]

And after fixing the imports:

./example_test.go:60:38: not enough arguments in call to genai.NewClient

The errors are trivial but I suspect we don't have jba's latest code.

Deleplace avatar Apr 29 '24 20:04 Deleplace

Sorry for the wait. I fixed the compilation problem and the feature now works with gemini-1.0-pro. Removing draft status.

jba avatar Apr 29 '24 23:04 jba