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.36.0"
".": "0.37.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: 14
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai/perplexity-0503b4a7abdf2cb4ad14af7b17bca179796f868729dfdfc8e09692e0dca99dda.yml
openapi_spec_hash: 629684ee997a5334c38080865371b0fa
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai/perplexity-9fca0405579d6d1a2b8e686dfa59daaaf3a60d0627d0638c8079c6d85a4ff7d9.yml
openapi_spec_hash: 68e5745c9b747b7aa5f46da6c746e4ea
config_hash: 25a3795c176e58c4127154760d603480
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.37.0 (2026-07-17)

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

### Features

* **responses:** add skills param with built-in and inline skills ([5e5578f](https://github.com/perplexityai/perplexity-node/commit/5e5578f788f5e9ce999c804758f52c0507ac4885))

## 0.36.0 (2026-07-15)

Full Changelog: [v0.35.0...v0.36.0](https://github.com/perplexityai/perplexity-node/compare/v0.35.0...v0.36.0)
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.36.0",
"version": "0.37.0",
"description": "The official TypeScript library for the Perplexity API",
"author": "Perplexity <api@perplexity.ai>",
"types": "dist/index.d.ts",
Expand Down
24 changes: 14 additions & 10 deletions src/lib/add-output-text.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,22 @@
/**
* Response interface with output_text property added.
* This will match the ResponseCreateResponse type once generated.
* `output` is intentionally loose: OutputItem is a discriminated union whose
* members carry different `content` shapes (message items use content parts,
* sandbox_read_file uses a string), so we only require the discriminator here
* and narrow message content at the use site.
*/
interface Response {
object: 'response';
output: Array<{
type: string;
content?: Array<{
type: string;
text?: string;
}>;
}>;
output: Array<{ type: string }>;
output_text?: string;
}

interface MessageContentPart {
type: string;
text?: string;
}

/**
* Adds the output_text convenience property to a Response object.
* Aggregates all output_text items from the output list.
Expand All @@ -31,9 +34,10 @@ export function addOutputText(rsp: Response): void {
if (output.type !== 'message') {
continue;
}
for (const content of output.content || []) {
if (content.type === 'output_text' && content.text) {
texts.push(content.text);
const content = (output as { content?: Array<MessageContentPart> }).content;
for (const part of content || []) {
if (part.type === 'output_text' && part.text) {
texts.push(part.text);
}
}
}
Expand Down
Loading