Skip to content

Commit 6574f39

Browse files
committed
Merge remote-tracking branch 'upstream/master' into add-new-tool-call-streaming
2 parents b0f8818 + 0732dd6 commit 6574f39

File tree

25 files changed

+677
-213
lines changed

25 files changed

+677
-213
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "6.9.1"
2+
".": "6.10.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 135
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-a7e92d12ebe89ca019a7ac5b29759064eefa2c38fe08d03516f2620e66abb32b.yml
3-
openapi_spec_hash: acbc703b2739447abc6312b2d753631c
4-
config_hash: b876221dfb213df9f0a999e75d38a65e
1+
configured_endpoints: 136
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-fe8a79e6fd407e6c9afec60971f03076b65f711ccd6ea16457933b0e24fb1f6d.yml
3+
openapi_spec_hash: 38c0a73f4e08843732c5f8002a809104
4+
config_hash: 2c350086d87a4b4532077363087840e7

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## 6.10.0 (2025-12-04)
4+
5+
Full Changelog: [v6.9.1...v6.10.0](https://github.com/openai/openai-node/compare/v6.9.1...v6.10.0)
6+
7+
### Features
8+
9+
* **api:** gpt-5.1-codex-max and responses/compact ([935f79e](https://github.com/openai/openai-node/commit/935f79efbb090d1d6016ac6874456594f5fd4553))
10+
11+
12+
### Chores
13+
14+
* **client:** fix logger property type ([fdc671f](https://github.com/openai/openai-node/commit/fdc671f1b21249a8610b38e2535910d956dc3611))
15+
* **internal:** upgrade eslint ([9de0f90](https://github.com/openai/openai-node/commit/9de0f905bbd965a5d945ddb70c66dc0c6403ed35))
16+
317
## 6.9.1 (2025-11-17)
418

519
Full Changelog: [v6.9.0...v6.9.1](https://github.com/openai/openai-node/compare/v6.9.0...v6.9.1)

MIGRATION.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ client.example.list(undefined, { headers: { ... } });
134134
- `client.beta.threads.messages.list()`
135135
- `client.batches.list()`
136136
- `client.responses.retrieve()`
137+
- `client.responses.compact()`
137138
- `client.responses.inputItems.list()`
138139
- `client.responses.inputTokens.count()`
139140
- `client.realtime.calls.reject()`

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ Methods:
696696
Types:
697697

698698
- <code><a href="./src/resources/responses/responses.ts">ApplyPatchTool</a></code>
699+
- <code><a href="./src/resources/responses/responses.ts">CompactedResponse</a></code>
699700
- <code><a href="./src/resources/responses/responses.ts">ComputerTool</a></code>
700701
- <code><a href="./src/resources/responses/responses.ts">CustomTool</a></code>
701702
- <code><a href="./src/resources/responses/responses.ts">EasyInputMessage</a></code>
@@ -715,6 +716,8 @@ Types:
715716
- <code><a href="./src/resources/responses/responses.ts">ResponseCodeInterpreterCallInProgressEvent</a></code>
716717
- <code><a href="./src/resources/responses/responses.ts">ResponseCodeInterpreterCallInterpretingEvent</a></code>
717718
- <code><a href="./src/resources/responses/responses.ts">ResponseCodeInterpreterToolCall</a></code>
719+
- <code><a href="./src/resources/responses/responses.ts">ResponseCompactionItem</a></code>
720+
- <code><a href="./src/resources/responses/responses.ts">ResponseCompactionItemParam</a></code>
718721
- <code><a href="./src/resources/responses/responses.ts">ResponseCompletedEvent</a></code>
719722
- <code><a href="./src/resources/responses/responses.ts">ResponseComputerToolCall</a></code>
720723
- <code><a href="./src/resources/responses/responses.ts">ResponseComputerToolCallOutputItem</a></code>
@@ -822,6 +825,7 @@ Methods:
822825
- <code title="get /responses/{response_id}">client.responses.<a href="./src/resources/responses/responses.ts">retrieve</a>(responseID, { ...params }) -> Response</code>
823826
- <code title="delete /responses/{response_id}">client.responses.<a href="./src/resources/responses/responses.ts">delete</a>(responseID) -> void</code>
824827
- <code title="post /responses/{response_id}/cancel">client.responses.<a href="./src/resources/responses/responses.ts">cancel</a>(responseID) -> Response</code>
828+
- <code title="post /responses/compact">client.responses.<a href="./src/resources/responses/responses.ts">compact</a>({ ...params }) -> CompactedResponse</code>
825829

826830
## InputItems
827831

@@ -869,6 +873,7 @@ Types:
869873
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferClearedEvent</a></code>
870874
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferCommitEvent</a></code>
871875
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferCommittedEvent</a></code>
876+
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferDtmfEventReceivedEvent</a></code>
872877
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferSpeechStartedEvent</a></code>
873878
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferSpeechStoppedEvent</a></code>
874879
- <code><a href="./src/resources/realtime/realtime.ts">InputAudioBufferTimeoutTriggered</a></code>

examples/debugging.ts

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import OpenAI from 'openai';
2+
import { betaZodFunctionTool } from 'openai/helpers/beta/zod';
3+
import { z } from 'zod';
4+
5+
const client = new OpenAI();
6+
7+
async function main() {
8+
// Define the schema using oneOf
9+
const searchSchema = z.object({
10+
searchCriteria: z.object({
11+
// This creates a oneOf in the JSON Schema
12+
criteria: z.union([
13+
z.object({
14+
name: z.string().describe('Search by name'),
15+
type: z.enum(['person', 'product', 'location']).describe('Type of entity to search for')
16+
}),
17+
z.object({
18+
id: z.number().describe('Search by numeric ID'),
19+
includeDeleted: z.boolean().optional().describe('Whether to include deleted items')
20+
})
21+
])
22+
})
23+
});
24+
25+
const message = await client.beta.chat.completions.toolRunner({
26+
messages: [
27+
{
28+
role: 'user',
29+
content: `I need to search for something. You can search by either name or ID.`,
30+
},
31+
],
32+
tools: [
33+
betaZodFunctionTool({
34+
name: 'searchDatabase',
35+
description: 'Search database for items by either name or ID',
36+
parameters: searchSchema,
37+
run: (params) => {
38+
const criteria = params.searchCriteria.criteria;
39+
40+
if ('name' in criteria) {
41+
return `Found 3 results for name "${criteria.name}" of type "${criteria.type}"`;
42+
} else {
43+
const deletedStatus = criteria.includeDeleted ? ' (including deleted items)' : '';
44+
return `Found item with ID ${criteria.id}${deletedStatus}`;
45+
}
46+
},
47+
}),
48+
],
49+
model: 'gpt-4o',
50+
max_tokens: 1024,
51+
max_iterations: 10,
52+
});
53+
54+
console.log('Final response:', message.content);
55+
}
56+
57+
main();

jsr.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openai/openai",
3-
"version": "6.9.1",
3+
"version": "6.10.0",
44
"exports": {
55
".": "./index.ts",
66
"./helpers/zod": "./helpers/zod.ts",

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openai",
3-
"version": "6.9.1",
3+
"version": "6.10.0",
44
"description": "The official TypeScript library for the OpenAI API",
55
"author": "OpenAI <support@openai.com>",
66
"types": "dist/index.d.ts",
@@ -40,7 +40,7 @@
4040
"@typescript-eslint/parser": "8.31.1",
4141
"@typescript-eslint/typescript-estree": "8.31.1",
4242
"deep-object-diff": "^1.1.9",
43-
"eslint": "^9.20.1",
43+
"eslint": "^9.39.1",
4444
"eslint-plugin-prettier": "^5.4.1",
4545
"eslint-plugin-unused-imports": "^4.1.4",
4646
"execa": "^5.1.1",

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ export class OpenAI {
339339
baseURL: string;
340340
maxRetries: number;
341341
timeout: number;
342-
logger: Logger | undefined;
342+
logger: Logger;
343343
logLevel: LogLevel | undefined;
344344
fetchOptions: MergedRequestInit | undefined;
345345

src/resources/beta/assistants.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,16 +1160,17 @@ export interface AssistantCreateParams {
11601160
/**
11611161
* Constrains effort on reasoning for
11621162
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1163-
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
1164-
* reasoning effort can result in faster responses and fewer tokens used on
1165-
* reasoning in a response.
1163+
* supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`.
1164+
* Reducing reasoning effort can result in faster responses and fewer tokens used
1165+
* on reasoning in a response.
11661166
*
11671167
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
11681168
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
11691169
* calls are supported for all reasoning values in gpt-5.1.
11701170
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
11711171
* support `none`.
11721172
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1173+
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
11731174
*/
11741175
reasoning_effort?: Shared.ReasoningEffort | null;
11751176

@@ -1420,16 +1421,17 @@ export interface AssistantUpdateParams {
14201421
/**
14211422
* Constrains effort on reasoning for
14221423
* [reasoning models](https://platform.openai.com/docs/guides/reasoning). Currently
1423-
* supported values are `none`, `minimal`, `low`, `medium`, and `high`. Reducing
1424-
* reasoning effort can result in faster responses and fewer tokens used on
1425-
* reasoning in a response.
1424+
* supported values are `none`, `minimal`, `low`, `medium`, `high`, and `xhigh`.
1425+
* Reducing reasoning effort can result in faster responses and fewer tokens used
1426+
* on reasoning in a response.
14261427
*
14271428
* - `gpt-5.1` defaults to `none`, which does not perform reasoning. The supported
14281429
* reasoning values for `gpt-5.1` are `none`, `low`, `medium`, and `high`. Tool
14291430
* calls are supported for all reasoning values in gpt-5.1.
14301431
* - All models before `gpt-5.1` default to `medium` reasoning effort, and do not
14311432
* support `none`.
14321433
* - The `gpt-5-pro` model defaults to (and only supports) `high` reasoning effort.
1434+
* - `xhigh` is currently only supported for `gpt-5.1-codex-max`.
14331435
*/
14341436
reasoning_effort?: Shared.ReasoningEffort | null;
14351437

0 commit comments

Comments
 (0)