Skip to content

Commit 9214000

Browse files
authored
Merge pull request #6824 from TIANQIAN1238/feat-test-is-gpt4-model
test: add unit tests for isGPT4Model
2 parents a27401a + 180d062 commit 9214000

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

test/is-gpt4-model.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { isGPT4Model } from "../app/utils/model";
2+
3+
describe("isGPT4Model", () => {
4+
test("matches the gpt-4, chatgpt-4o and o1 families", () => {
5+
expect(isGPT4Model("gpt-4")).toBe(true);
6+
expect(isGPT4Model("gpt-4-turbo")).toBe(true);
7+
expect(isGPT4Model("gpt-4o")).toBe(true);
8+
expect(isGPT4Model("chatgpt-4o-latest")).toBe(true);
9+
expect(isGPT4Model("o1-preview")).toBe(true);
10+
});
11+
12+
test("excludes gpt-4o-mini", () => {
13+
expect(isGPT4Model("gpt-4o-mini")).toBe(false);
14+
});
15+
16+
test("does not match non-gpt-4 models", () => {
17+
expect(isGPT4Model("gpt-3.5-turbo")).toBe(false);
18+
expect(isGPT4Model("o3-mini")).toBe(false);
19+
expect(isGPT4Model("claude-3-opus")).toBe(false);
20+
});
21+
});

0 commit comments

Comments
 (0)