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_clientAPIPromise
Class●Since v0.8

APIPromise

A subclass of Promise providing additional helper methods for interacting with the SDK.

Copy
class APIPromise

Bases

Promise<T>

Constructors

constructor
constructor

Properties

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

Methods

method
_thenUnwrap→ APIPromise<U>
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
View source on GitHub