LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmith_openapi_client_streamingAsyncStream
Class●Since v0.8

AsyncStream

Copy
AsyncStream(
  self,
  *,
  cast_to: type[_T],
  response: httpx.Response,
  client: AsyncLangsmith,
  options

Bases

Generic[_T]

Constructors

Attributes

Methods

View source on GitHub
:
Optional
[
FinalRequestOptions
]
=
None
)
constructor
__init__
NameType
cast_totype[_T]
responsehttpx.Response
clientAsyncLangsmith
optionsOptional[FinalRequestOptions]
attribute
response: httpx.Response
method
close

Provides the core interface to iterate over an asynchronous stream response.

Close the response and release the connection.

Automatically called if the response body is read to completion.