Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "5.15.0"
".": "5.16.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 119
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-ddbdf9343316047e8a773c54fb24e4a8d225955e202a1888fde6f9c8898ebf98.yml
openapi_spec_hash: 9802f6dd381558466c897f6e387e06ca
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/openai%2Fopenai-8517ffa1004e31ca2523d617629e64be6fe4f13403ddfd9db5b3be002656cbde.yml
openapi_spec_hash: b64dd8c8b23082a7aa2a3e5c5fffd8bd
config_hash: fe0ea26680ac2075a6cd66416aefe7db
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## 5.16.0 (2025-08-26)

Full Changelog: [v5.15.0...v5.16.0](https://github.com/openai/openai-node/compare/v5.15.0...v5.16.0)

### Features

* **api:** add web search filters ([975b141](https://github.com/openai/openai-node/commit/975b1417052bdcc0111f546ce3fbbea2e71414af))


### Chores

* **client:** qualify global Blob ([7998d3f](https://github.com/openai/openai-node/commit/7998d3fd3715ab2c06ea011155420ac126681649))
* update CI script ([accb0c1](https://github.com/openai/openai-node/commit/accb0c1188dbaef20c1a40bd3047087960c99a07))

## 5.15.0 (2025-08-21)

Full Changelog: [v5.14.0...v5.15.0](https://github.com/openai/openai-node/compare/v5.14.0...v5.15.0)
Expand Down
2 changes: 1 addition & 1 deletion jsr.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openai/openai",
"version": "5.15.0",
"version": "5.16.0",
"exports": {
".": "./index.ts",
"./helpers/zod": "./helpers/zod.ts",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openai",
"version": "5.15.0",
"version": "5.16.0",
"description": "The official TypeScript library for the OpenAI API",
"author": "OpenAI <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion scripts/utils/upload-artifact.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ if [[ "$SIGNED_URL" == "null" ]]; then
exit 1
fi

UPLOAD_RESPONSE=$(tar -cz dist | curl -v -X PUT \
UPLOAD_RESPONSE=$(tar -cz "${BUILD_PATH:-dist}" | curl -v -X PUT \
-H "Content-Type: application/gzip" \
--data-binary @- "$SIGNED_URL" 2>&1)

Expand Down
2 changes: 1 addition & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,7 @@ export class OpenAI {
// Preserve legacy string encoding behavior for now
headers.values.has('content-type')) ||
// `Blob` is superset of `File`
body instanceof Blob ||
((globalThis as any).Blob && body instanceof (globalThis as any).Blob) ||
// `FormData` -> `multipart/form-data`
body instanceof FormData ||
// `URLSearchParams` -> `application/x-www-form-urlencoded`
Expand Down
2 changes: 1 addition & 1 deletion src/resources/conversations/conversations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export class Conversations extends APIResource {
items: ItemsAPI.Items = new ItemsAPI.Items(this._client);

/**
* Create a conversation with the given ID.
* Create a conversation.
*/
create(body: ConversationCreateParams, options?: RequestOptions): APIPromise<Conversation> {
return this._client.post('/conversations', { body, ...options });
Expand Down
2 changes: 2 additions & 0 deletions src/resources/conversations/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,8 @@ export interface ItemListParams extends ConversationCursorPageParams {
* Specify additional output data to include in the model response. Currently
* supported values are:
*
* - `web_search_call.action.sources`: Include the sources of the web search tool
* call.
* - `code_interpreter_call.outputs`: Includes the outputs of python code execution
* in code interpreter tool call items.
* - `computer_call_output.output.image_url`: Include image urls from the computer
Expand Down
113 changes: 111 additions & 2 deletions src/resources/responses/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1949,6 +1949,28 @@ export namespace ResponseFunctionWebSearch {
* The action type.
*/
type: 'search';

/**
* The sources used in the search.
*/
sources?: Array<Search.Source>;
}

export namespace Search {
/**
* A source used in the search.
*/
export interface Source {
/**
* The type of source. Always `url`.
*/
type: 'url';

/**
* The URL of the source.
*/
url: string;
}
}

/**
Expand Down Expand Up @@ -2124,6 +2146,12 @@ export interface ResponseInProgressEvent {
* Specify additional output data to include in the model response. Currently
* supported values are:
*
* - `web_search_call.action.sources`: Include the sources of the web search tool
* call.
* - `code_interpreter_call.outputs`: Includes the outputs of python code execution
* in code interpreter tool call items.
* - `computer_call_output.output.image_url`: Include image urls from the computer
* call output.
* - `file_search_call.results`: Include the search results of the file search tool
* call.
* - `message.input_image.image_url`: Include image urls from the input message.
Expand Down Expand Up @@ -4625,15 +4653,90 @@ export interface ResponseWebSearchCallSearchingEvent {
export type Tool =
| FunctionTool
| FileSearchTool
| WebSearchTool
| ComputerTool
| Tool.WebSearchTool
| Tool.Mcp
| Tool.CodeInterpreter
| Tool.ImageGeneration
| Tool.LocalShell
| CustomTool;
| CustomTool
| WebSearchTool;

export namespace Tool {
/**
* Search the Internet for sources related to the prompt. Learn more about the
* [web search tool](https://platform.openai.com/docs/guides/tools-web-search).
*/
export interface WebSearchTool {
/**
* The type of the web search tool. One of `web_search` or `web_search_2025_08_26`.
*/
type: 'web_search' | 'web_search_2025_08_26';

/**
* Filters for the search.
*/
filters?: WebSearchTool.Filters | null;

/**
* High level guidance for the amount of context window space to use for the
* search. One of `low`, `medium`, or `high`. `medium` is the default.
*/
search_context_size?: 'low' | 'medium' | 'high';

/**
* The approximate location of the user.
*/
user_location?: WebSearchTool.UserLocation | null;
}

export namespace WebSearchTool {
/**
* Filters for the search.
*/
export interface Filters {
/**
* Allowed domains for the search. If not provided, all domains are allowed.
* Subdomains of the provided domains are allowed as well.
*
* Example: `["pubmed.ncbi.nlm.nih.gov"]`
*/
allowed_domains?: Array<string> | null;
}

/**
* The approximate location of the user.
*/
export interface UserLocation {
/**
* Free text input for the city of the user, e.g. `San Francisco`.
*/
city?: string | null;

/**
* The two-letter [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1) of
* the user, e.g. `US`.
*/
country?: string | null;

/**
* Free text input for the region of the user, e.g. `California`.
*/
region?: string | null;

/**
* The [IANA timezone](https://timeapi.io/documentation/iana-timezones) of the
* user, e.g. `America/Los_Angeles`.
*/
timezone?: string | null;

/**
* The type of location approximation. Always `approximate`.
*/
type?: 'approximate';
}
}

/**
* Give the model access to additional tools via remote Model Context Protocol
* (MCP) servers.
Expand Down Expand Up @@ -5122,6 +5225,12 @@ export interface ResponseCreateParamsBase {
* Specify additional output data to include in the model response. Currently
* supported values are:
*
* - `web_search_call.action.sources`: Include the sources of the web search tool
* call.
* - `code_interpreter_call.outputs`: Includes the outputs of python code execution
* in code interpreter tool call items.
* - `computer_call_output.output.image_url`: Include image urls from the computer
* call output.
* - `file_search_call.results`: Include the search results of the file search tool
* call.
* - `message.input_image.image_url`: Include image urls from the input message.
Expand Down
2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const VERSION = '5.15.0'; // x-release-please-version
export const VERSION = '5.16.0'; // x-release-please-version