LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangSmith
  • Client
  • Run Trees
  • Traceable
  • Evaluation
  • Schemas
  • Langchain
  • Jest
  • Vitest
  • Wrappers
  • Anonymizer
  • Jestlike
  • Vercel
  • Anthropic
  • Sandbox
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangSmith
ClientRun TreesTraceableEvaluationSchemasLangchainJestVitestWrappersAnonymizerJestlikeVercelAnthropicSandbox
Language
Theme
JavaScriptlangsmith_openapi_clientPagePromise
Class●Since v0.8

PagePromise

This subclass of Promise will resolve to an instantiated Page once the request completes.

It also implements AsyncIterable to allow auto-paginating iteration on an unawaited list call, eg:

for await (const item of client.items.list()) { console.log(item) }

Copy
class PagePromise

Bases

APIPromise<PageClass>

Constructors

constructor
constructor

Properties

property
[toStringTag]: string
property
[species]: PromiseConstructor

Methods

method
_thenUnwrap→ APIPromise<U>
method
[asyncIterator]→ AsyncGenerator<Item>
method
asResponse→ Promise<Response>

Gets the raw Response instance instead of parsing the response data.

If you want to parse the response body but still get the Response instance, you can use ().

👋 Getting the wrong TypeScript type for Response? Try setting "moduleResolution": "NodeNext" or add "lib": ["DOM"] to your tsconfig.json.

method
catch→ Promise<T | TResult>

Attaches a callback for only the rejection of the Promise.

method
finally→ Promise<T>

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

method
then→ Promise<TResult1 | TResult2>

Attaches callbacks for the resolution and/or rejection of the Promise.

method
withResponse→ Promise<__type>

Gets the parsed response data and the raw Response instance.

If you just want to get the raw Response instance without parsing it, you can use ().

👋 Getting the wrong TypeScript type for Response? Try setting "moduleResolution": "NodeNext" or add "lib": ["DOM"] to your tsconfig.json.

method
all
method
allSettled
method
any
method
race
method
reject
method
resolve

Inherited fromAPIPromise

Methods

M_thenUnwrap→ APIPromise<U>MasResponse→ Promise<Response>
—

Gets the raw Response instance instead of parsing the response

Mcatch→ Promise<T | TResult>
—

Attaches a callback for only the rejection of the Promise.

Mfinally→ Promise<T>
—

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The

Mthen→ Promise<TResult1 | TResult2>
—

Attaches callbacks for the resolution and/or rejection of the Promise.

MwithResponse→ Promise<__type>
—

Gets the parsed response data and the raw Response instance.

MallMallSettledManyMraceMrejectMresolve
View source on GitHub