Closed Rodrigodd closed 2 months ago
This seems to be a bug, will look into fixing.
is this sequence behaves correct?I call the function this way:
const model = genAI.getGenerativeModel({ model: "gemini-1.5-pro-latest", systemInstruction: { role: "system", parts: [{ text: "your name is bob" }] }, }, { apiVersion: 'v1beta', generationConfig, safetySettings });
No, the original code snippet is not exactly correct but I think it's just a typo, generationConfig definitely wasn't getting passed to chatSession, working on fixing this. I think your code snippet is also incorrect, generationConfig and safetySettings should be in the first object, not the second.
Actual Behavior
The docs mention that you can pass model parameters to
genAI.getGenerativeModel.getGenerativeModel
:But if you pass the parameters there, they are silently ignored when using
model.startChat
API. You need to pass these parameters directly tostartChat
, even though it is already a method ofGenerativeModel
.I confirmed that by making the requests through a proxy (https://httptoolkit.com/).
The same applies for
safetySettings
.Expected Behavior
model.startChat
should inheritgenerationConfig
,safetySettings
, etc., frommodel
.Specifications