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
23 changes: 23 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# syntax=docker/dockerfile:1
FROM debian:bookworm-slim AS stainless

RUN apt-get update && apt-get install -y \
nodejs \
npm \
yarnpkg \
&& apt-get clean autoclean

# Ensure UTF-8 encoding
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8

# Yarn
RUN ln -sf /usr/bin/yarnpkg /usr/bin/yarn

WORKDIR /workspace

COPY package.json yarn.lock /workspace/

RUN yarn install

COPY . /workspace
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'unused-imports', 'prettier'],
rules: {
'no-unused-vars': 'off',
'prettier/prettier': 'error',
'unused-imports/no-unused-imports': 'error',
},
root: true,
};
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.17.0"
".": "0.18.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: 5
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-a251035716e17e7699e06dc69d4d7ab44ff3a8bde20bf3d35ecb03f6536b0f19.yml
openapi_spec_hash: 60fd7b4e1f54d41e944a5f2ec6744ef8
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/perplexity-ai%2Fperplexity-625f4b8c8e0776ba42d4848352701e8a482c732f47b4570bcc6bd55d0fa40d4f.yml
openapi_spec_hash: 81b4e099cc6c902cacac6cfae611157f
config_hash: 5b10428c82f4119aa4837f03046d0e5c
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
# Changelog

## 0.18.0 (2025-12-05)

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

### Features

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


### Bug Fixes

* **mcp:** correct code tool API endpoint ([d7be1ad](https://github.com/perplexityai/perplexity-node/commit/d7be1ad64f691f68b9fd626ff657ff58056bb0a1))
* **mcp:** return correct lines on typescript errors ([2719b53](https://github.com/perplexityai/perplexity-node/commit/2719b530e2560713cdba9a407ad74a5bf8cd0f32))


### Chores

* **internal:** codegen related update ([6ac26a8](https://github.com/perplexityai/perplexity-node/commit/6ac26a8aeebf04d7d1f2f0e4e9241d2327a3eb70))

## 0.17.0 (2025-12-02)

Full Changelog: [v0.16.0...v0.17.0](https://github.com/perplexityai/perplexity-node/compare/v0.16.0...v0.17.0)
Expand Down
Empty file added jest.setup.ts
Empty file.
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.17.0",
"version": "0.18.0",
"description": "The official TypeScript library for the Perplexity API",
"author": "Perplexity <[email protected]>",
"types": "dist/index.d.ts",
Expand Down
14 changes: 14 additions & 0 deletions src/internal/polyfill/file.node.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* This file polyfills the global `File` object for you if it's not already defined
* when running on Node.js
*
* This is only needed on Node.js v18 & v19. Newer versions already define `File`
* as a global.
*/

// @ts-ignore
type nodeBuffer = typeof import('node:buffer');
declare const File: typeof globalThis extends { File: unknown } ? (typeof globalThis)['File']
: nodeBuffer extends { File: unknown } ? nodeBuffer['File']
: any;
export {};
9 changes: 9 additions & 0 deletions src/internal/polyfill/file.node.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This file polyfills the global `File` object for you if it's not already defined
* when running on Node.js
*
* This is only needed on Node.js v18 & v19. Newer versions already define `File`
* as a global.
*/

import './file.node.js';
4 changes: 4 additions & 0 deletions src/resources/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ export interface SearchCreateParams {

display_server_time?: boolean;

last_updated_after_filter?: string | null;

last_updated_before_filter?: string | null;

max_results?: number;

max_tokens?: number;
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.17.0'; // x-release-please-version
export const VERSION = '0.18.0'; // x-release-please-version
2 changes: 2 additions & 0 deletions tests/api-resources/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ describe('resource search', () => {
query: 'string',
country: 'country',
display_server_time: true,
last_updated_after_filter: 'last_updated_after_filter',
last_updated_before_filter: 'last_updated_before_filter',
max_results: 0,
max_tokens: 0,
max_tokens_per_page: 0,
Expand Down
24 changes: 24 additions & 0 deletions tests/responses.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { createResponseHeaders } from '@perplexity-ai/perplexity_ai/internal/headers';

Check failure on line 1 in tests/responses.test.ts

View workflow job for this annotation

GitHub Actions / lint

Module '"@perplexity-ai/perplexity_ai/internal/headers"' has no exported member 'createResponseHeaders'.

describe('response parsing', () => {
// TODO: test unicode characters
test('headers are case agnostic', async () => {
const headers = createResponseHeaders(new Headers({ 'Content-Type': 'foo', Accept: 'text/plain' }));
expect(headers['content-type']).toEqual('foo');
expect(headers['Content-type']).toEqual('foo');
expect(headers['Content-Type']).toEqual('foo');
expect(headers['accept']).toEqual('text/plain');
expect(headers['Accept']).toEqual('text/plain');
expect(headers['Hello-World']).toBeUndefined();
});

test('duplicate headers are concatenated', () => {
const headers = createResponseHeaders(
new Headers([
['Content-Type', 'text/xml'],
['Content-Type', 'application/json'],
]),
);
expect(headers['content-type']).toBe('text/xml, application/json');
});
});
Loading