-
Notifications
You must be signed in to change notification settings - Fork 83
Expand file tree
/
Copy pathopenai-thinking.test.ts
More file actions
36 lines (31 loc) · 1.37 KB
/
openai-thinking.test.ts
File metadata and controls
36 lines (31 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { test } from "node:test";
import assert from "node:assert/strict";
import { buildThinkingRequestOptions } from "../common/openai-thinking";
test("buildThinkingRequestOptions explicitly disables thinking", () => {
assert.deepEqual(buildThinkingRequestOptions(false, "https://api.deepseek.com"), {
thinking: { type: "disabled" },
});
});
test("buildThinkingRequestOptions uses the same disabled payload for volces endpoints", () => {
assert.deepEqual(buildThinkingRequestOptions(false, "https://ark.cn-beijing.volces.com/api/v3"), {
thinking: { type: "disabled" },
});
});
test("buildThinkingRequestOptions enables thinking with default reasoning effort", () => {
assert.deepEqual(buildThinkingRequestOptions(true, "https://api.deepseek.com"), {
thinking: { type: "enabled" },
extra_body: { reasoning_effort: "max" },
});
});
test("buildThinkingRequestOptions uses the same enabled payload for volces endpoints", () => {
assert.deepEqual(buildThinkingRequestOptions(true, "https://ark.cn-beijing.volces.com/api/v3"), {
thinking: { type: "enabled" },
extra_body: { reasoning_effort: "max" },
});
});
test("buildThinkingRequestOptions accepts high reasoning effort", () => {
assert.deepEqual(buildThinkingRequestOptions(true, "https://api.deepseek.com", "high"), {
thinking: { type: "enabled" },
extra_body: { reasoning_effort: "high" },
});
});