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 @@
{
".": "0.22.0"
".": "0.23.0"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 6
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-6ce12aa99a5f333ab79b62256b6e78ffeaf103c08f199c90e8122b9496bb0e85.yml
openapi_spec_hash: 22caa3446c4d9eaadbf185d5a70e8810
config_hash: 2a2b777ab44d79bde60bf3d1b5a2ed7b
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-3ee0511fa1bf59b2bb44d947f7d884fd8522ef872d33bab141874941b76f1dd7.yml
openapi_spec_hash: 394bbfe74954625b70de9c85d553e3d0
config_hash: c7d506cdee510785b58defa1a626e20b
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.23.0 (2026-01-27)

Full Changelog: [v0.22.0...v0.23.0](https://github.com/perplexityai/perplexity-node/compare/v0.22.0...v0.23.0)

### Features

* **api:** manual updates ([de17f18](https://github.com/perplexityai/perplexity-node/commit/de17f18fbf32d065a22680c06210baaf7ed9c9b8))

## 0.22.0 (2026-01-24)

Full Changelog: [v0.21.0...v0.22.0](https://github.com/perplexityai/perplexity-node/compare/v0.21.0...v0.22.0)
Expand Down
3 changes: 3 additions & 0 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Types:
- <code><a href="./src/resources/responses.ts">Annotation</a></code>
- <code><a href="./src/resources/responses.ts">ContentPart</a></code>
- <code><a href="./src/resources/responses.ts">ErrorInfo</a></code>
- <code><a href="./src/resources/responses.ts">FunctionCallOutputItem</a></code>
- <code><a href="./src/resources/responses.ts">FunctionTool</a></code>
- <code><a href="./src/resources/responses.ts">InputItem</a></code>
- <code><a href="./src/resources/responses.ts">OutputItem</a></code>
- <code><a href="./src/resources/responses.ts">ResponseStreamChunk</a></code>
- <code><a href="./src/resources/responses.ts">ResponsesCreateParams</a></code>
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": "@perplexity-ai/perplexity_ai",
"version": "0.22.0",
"version": "0.23.0",
"description": "The official TypeScript library for the Perplexity API",
"author": "Perplexity <api@perplexity.ai>",
"types": "dist/index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ import {
Annotation,
ContentPart,
ErrorInfo,
FunctionCallOutputItem,
FunctionTool,
InputItem,
OutputItem,
ResponseCreateParams,
ResponseCreateParamsNonStreaming,
Expand Down Expand Up @@ -757,6 +760,9 @@ export declare namespace Perplexity {
type Annotation as Annotation,
type ContentPart as ContentPart,
type ErrorInfo as ErrorInfo,
type FunctionCallOutputItem as FunctionCallOutputItem,
type FunctionTool as FunctionTool,
type InputItem as InputItem,
type OutputItem as OutputItem,
type ResponseStreamChunk as ResponseStreamChunk,
type ResponsesCreateParams as ResponsesCreateParams,
Expand Down
3 changes: 3 additions & 0 deletions src/resources/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ export {
type Annotation,
type ContentPart,
type ErrorInfo,
type FunctionCallOutputItem,
type FunctionTool,
type InputItem,
type OutputItem,
type ResponseStreamChunk,
type ResponsesCreateParams,
Expand Down
198 changes: 144 additions & 54 deletions src/resources/responses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,139 @@ export interface ErrorInfo {
type?: string;
}

export interface FunctionCallOutputItem {
id: string;

/**
* JSON string of arguments
*/
arguments: string;

/**
* Correlates with function_call_output input
*/
call_id: string;

name: string;

/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

type: 'function_call';

/**
* Base64-encoded opaque signature for thinking models
*/
thought_signature?: string;
}

export interface FunctionTool {
/**
* The name of the function
*/
name: string;

type: 'function';

/**
* A description of what the function does
*/
description?: string;

/**
* JSON Schema defining the function's parameters
*/
parameters?: { [key: string]: unknown };

/**
* Whether to enable strict schema validation
*/
strict?: boolean;
}

export type InputItem =
| InputItem.InputMessage
| InputItem.FunctionCallOutputInput
| InputItem.FunctionCallInput;

export namespace InputItem {
export interface InputMessage {
/**
* Message content - either a string or array of content parts
*/
content: string | Array<InputMessage.ContentPartArray>;

role: 'user' | 'assistant' | 'system' | 'developer';

type: 'message';
}

export namespace InputMessage {
export interface ContentPartArray {
type: 'input_text' | 'input_image';

image_url?: string;

text?: string;
}
}

export interface FunctionCallOutputInput {
/**
* The call_id from function_call output
*/
call_id: string;

/**
* Function result (JSON string)
*/
output: string;

type: 'function_call_output';

/**
* Function name (required by some providers)
*/
name?: string;

/**
* Base64-encoded signature from function_call
*/
thought_signature?: string;
}

export interface FunctionCallInput {
/**
* Function arguments (JSON string)
*/
arguments: string;

/**
* The call_id that correlates with function_call_output
*/
call_id: string;

/**
* The function name
*/
name: string;

type: 'function_call';

/**
* Base64-encoded signature for thinking models
*/
thought_signature?: string;
}
}

export type OutputItem =
| OutputItem.MessageOutputItem
| OutputItem.SearchResultsOutputItem
| OutputItem.FetchURLResultsOutputItem;
| OutputItem.FetchURLResultsOutputItem
| FunctionCallOutputItem;

export namespace OutputItem {
export interface MessageOutputItem {
Expand All @@ -98,7 +227,7 @@ export namespace OutputItem {
/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress';
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

type: 'message';
}
Expand Down Expand Up @@ -231,7 +360,7 @@ export namespace ResponseStreamChunk {
/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress';
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

error?: ResponsesAPI.ErrorInfo;

Expand Down Expand Up @@ -295,7 +424,7 @@ export namespace ResponseStreamChunk {
/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress';
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

error?: ResponsesAPI.ErrorInfo;

Expand Down Expand Up @@ -358,7 +487,7 @@ export namespace ResponseStreamChunk {
/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress';
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

error?: ResponsesAPI.ErrorInfo;

Expand Down Expand Up @@ -769,9 +898,9 @@ export namespace ResponseStreamChunk {

export interface ResponsesCreateParams {
/**
* Input content - either a string or array of input messages
* Input content - either a string or array of input items
*/
input: string | Array<ResponsesCreateParams.InputMessageArray>;
input: string | Array<InputItem>;

/**
* System instructions for the model
Expand Down Expand Up @@ -831,31 +960,10 @@ export interface ResponsesCreateParams {
/**
* Tools available to the model
*/
tools?: Array<ResponsesCreateParams.WebSearchTool | ResponsesCreateParams.FetchURLTool>;
tools?: Array<ResponsesCreateParams.WebSearchTool | ResponsesCreateParams.FetchURLTool | FunctionTool>;
}

export namespace ResponsesCreateParams {
export interface InputMessageArray {
/**
* Message content - either a string or array of content parts
*/
content: string | Array<InputMessageArray.ContentPartArray>;

role: 'user' | 'assistant' | 'system' | 'developer';

type?: 'message';
}

export namespace InputMessageArray {
export interface ContentPartArray {
type: 'input_text' | 'input_image';

image_url?: string;

text?: string;
}
}

export interface Reasoning {
/**
* How much effort the model should spend on reasoning
Expand Down Expand Up @@ -1002,7 +1110,7 @@ export interface ResponseCreateResponse {
/**
* Status of a response or output item
*/
status: 'completed' | 'failed' | 'in_progress';
status: 'completed' | 'failed' | 'in_progress' | 'requires_action';

error?: ErrorInfo;

Expand All @@ -1019,9 +1127,9 @@ export type ResponseCreateParams = ResponseCreateParamsNonStreaming | ResponseCr

export interface ResponseCreateParamsBase {
/**
* Input content - either a string or array of input messages
* Input content - either a string or array of input items
*/
input: string | Array<ResponseCreateParams.InputMessageArray>;
input: string | Array<InputItem>;

/**
* System instructions for the model
Expand Down Expand Up @@ -1081,31 +1189,10 @@ export interface ResponseCreateParamsBase {
/**
* Tools available to the model
*/
tools?: Array<ResponseCreateParams.WebSearchTool | ResponseCreateParams.FetchURLTool>;
tools?: Array<ResponseCreateParams.WebSearchTool | ResponseCreateParams.FetchURLTool | FunctionTool>;
}

export namespace ResponseCreateParams {
export interface InputMessageArray {
/**
* Message content - either a string or array of content parts
*/
content: string | Array<InputMessageArray.ContentPartArray>;

role: 'user' | 'assistant' | 'system' | 'developer';

type?: 'message';
}

export namespace InputMessageArray {
export interface ContentPartArray {
type: 'input_text' | 'input_image';

image_url?: string;

text?: string;
}
}

export interface Reasoning {
/**
* How much effort the model should spend on reasoning
Expand Down Expand Up @@ -1206,6 +1293,9 @@ export declare namespace Responses {
type Annotation as Annotation,
type ContentPart as ContentPart,
type ErrorInfo as ErrorInfo,
type FunctionCallOutputItem as FunctionCallOutputItem,
type FunctionTool as FunctionTool,
type InputItem as InputItem,
type OutputItem as OutputItem,
type ResponseStreamChunk as ResponseStreamChunk,
type ResponsesCreateParams as ResponsesCreateParams,
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 = '0.22.0'; // x-release-please-version
export const VERSION = '0.23.0'; // x-release-please-version