Skip to content

Commit

Permalink
Update test cases for new parameters to test generationConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
shilpakancharla committed Sep 26, 2024
1 parent 3c959e9 commit ed2b7fc
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/models/generative-model.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ describe("GenerativeModel", () => {
},
},
},
presencePenalty: 0.6,
frequencyPenalty: 0.5,
responseLogProbs: true,
logProbs: 2,
},
safetySettings: [
{
Expand Down Expand Up @@ -91,6 +95,18 @@ describe("GenerativeModel", () => {
expect(
genModel.generationConfig?.responseSchema.properties.testField.type,
).to.equal(SchemaType.STRING);
expect(genModel.generationConfig?.presencePenalty).to.equal(
0.6,
);
expect(genModel.generationConfig?.frequencyPenalty).to.equal(
0.5,
);
expect(genModel.generationConfig?.responseLogProbs).to.equal(
true
);
expect(genModel.generationConfig?.logProbs).to.equal(
2
);
expect(genModel.safetySettings?.length).to.equal(1);
expect(genModel.toolConfig?.functionCallingConfig.mode).to.equal(
FunctionCallingMode.NONE,
Expand Down

0 comments on commit ed2b7fc

Please sign in to comment.