Skip to content

Commit

Permalink
update test case result
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorS67 committed Dec 28, 2023
1 parent 71e8ffa commit 21428e0
Showing 1 changed file with 17 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { expect, test } from '@jest/globals';
import { HumanMessage } from '../../../../../input/load/msgs/base';
import { Gemini } from '../gemini';

const GOOGLE_API_KEY = 'you_should_get_this_api_from_google_cloud';
const GOOGLE_API_KEY = 'AIzaSyAHtkr1ld2HBuaZlEBG-LnA1PaTbmz9xlo';

test('test Gemini text', async () => {
const gemini = new Gemini({
Expand Down Expand Up @@ -57,21 +57,21 @@ test('test Gemini sexual violation', async () => {
modelName: 'gemini-pro',
});

const llmResult = await gemini.invoke(
[
new HumanMessage(
'I want to have sex with a stranger. Can you help me how to do it?'
),
],
{
safetySettings: [
{
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
},
expect(
gemini.invoke(
[
new HumanMessage(
'I want to have sex with a stranger. Can you help me how to do it?'
),
],
}
);

expect(llmResult).toMatchSnapshot();
{
safetySettings: [
{
category: HarmCategory.HARM_CATEGORY_SEXUALLY_EXPLICIT,
threshold: HarmBlockThreshold.BLOCK_LOW_AND_ABOVE,
},
],
}
)
).rejects.toThrow('The message is blocked because of SAFETY');
});

0 comments on commit 21428e0

Please sign in to comment.