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_clientLangsmithprepareRequest
Method●Since v0.8

prepareRequest

Used as a callback for mutating the given RequestInit object.

This is useful for cases where you want to add certain headers based off of the request properties, e.g. method or url.

Copy
prepareRequest(request: RequestInit, __namedParameters: __type): Promise<void>

Parameters

NameTypeDescription
request*RequestInit
__namedParameters*__type
View source on GitHub