Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

model-sampling-support.test.ts

46 lines1.1 KB

1import { describe, expect, it } from 'vitest'
2import { openAIModelRejectsSamplingParams } from '../src/model-meta'
3​
4describe('openAIModelRejectsSamplingParams', () => {
5 it('flags o-series and GPT-5 reasoning models', () => {
6 for (const model of [
7 'o1',
8 'o1-pro',
9 'o3',
10 'o3-mini',
11 'o4-mini',
12 'gpt-5',
13 'gpt-5-mini',
14 'gpt-5-pro',
15 'gpt-5.1',
16 'gpt-5.2',
17 'gpt-5.2-pro',
18 'gpt-5.5',
19 'gpt-5.5-pro',
20 'gpt-5.6',
21 'gpt-5.6-sol',
22 'gpt-5.6-terra',
23 'gpt-5.6-luna',
24 'gpt-5.1-codex-mini',
25 'codex-mini-latest',
26 ]) {
27 expect(openAIModelRejectsSamplingParams(model), model).toBe(true)
28 }
29 })
30​
31 it('leaves chat-latest and pre-5 chat models alone', () => {
32 for (const model of [
33 'gpt-5-chat-latest',
34 'gpt-5.1-chat-latest',
35 'gpt-5.2-chat-latest',
36 'gpt-chat-latest',
37 'chatgpt-4o-latest',
38 'gpt-4.1',
39 'gpt-4o',
40 'gpt-4o-mini',
41 'gpt-3.5-turbo',
42 ]) {
43 expect(openAIModelRejectsSamplingParams(model), model).toBe(false)
44 }
45 })
46})