generative-ai-go icon indicating copy to clipboard operation
generative-ai-go copied to clipboard

when the go sdk will support System instructions setting in GenerativeModel of Client

Open Achillesxu opened this issue 1 year ago • 4 comments

when the go sdk will support System instructions setting in GenerativeModel of Client, now i am using 0.11.0

Achillesxu avatar Apr 23 '24 09:04 Achillesxu

i am also facing an issue where api will throw a 400 error when calling SendMessage after i have set model.systemInstruction

watahak avatar Apr 24 '24 10:04 watahak

Setting SystemInstruction should work now, you can see an example at https://pkg.go.dev/github.com/google/generative-ai-go/genai#example-GenerativeModel.GenerateContent-Config

Note that you need a Gemini 1.5 model for that, since 1.0 doesn't support system instructions. Set the model name to "gemini-1.5-pro-latest"

eliben avatar Apr 24 '24 12:04 eliben

Since the example in go package, model := client.GenerativeModel("gemini-1.0-pro") , uses 1.0, I wasn't aware that the 1.0 doesn't support the system instructions. Also it is not mentioned in docs that system instruction is exclusive to 1.5. Is it possible to learn if 1.0 will ever get system instructions? If not example in go package is misleading.

ozen-alp avatar Apr 24 '24 13:04 ozen-alp

#92 fixes the example to use an appropriate model.

Is it possible to learn if 1.0 will ever get system instructions?

Unfortunately, we don't know.

eliben avatar Apr 24 '24 16:04 eliben