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

Chat LangChain

What can I help with?

Enter to sendยทShift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDK
Language
Theme
Pythonlangsmith_responseStreamedBinaryAPIResponse
Classโ—Since v0.14

StreamedBinaryAPIResponse

Copy
StreamedBinaryAPIResponse(
  self,
  *,
  raw: httpx.Response,
  cast_to: type[R],
  client: BaseClient

Bases

APIResponse[bytes]

Methods

Inherited fromAPIResponse

Methods

Mparse
โ€”

Returns the rich python representation of this response's data.

Mread
โ€”

Read and return the binary response content.

Mtext
โ€”

Read and decode the response content into a string.

Mjson
โ€”
View source on GitHub
[
Any
,
Any
]
,
stream
:
bool
,
stream_cls
:
type
[
Stream
[
Any
]
]
|
type
[
AsyncStream
[
Any
]
]
|
None
,
options
:
FinalRequestOptions
,
retries_taken
:
int
=
0
)

Read and decode the JSON response content.

Mclose
โ€”

Close the response and release the connection.

Miter_bytes
โ€”

A byte-iterator over the decoded response content.

Miter_text
โ€”

A str-iterator over the decoded response content

Miter_lines
โ€”

Like iter_text() but will only yield chunks for each line

Inherited fromBaseAPIResponse

Attributes

Ahttp_response: httpx.ResponseAretries_taken: int
โ€”

The number of retries made. If no retries happened this will be 0

Aheaders: httpx.HeadersAhttp_request: httpx.Request
โ€”

Returns the httpx Request instance associated with the current response.

Astatus_code: intAurl: httpx.URL
โ€”

Returns the URL for which the request was made.

Amethod: strAhttp_version: strAelapsed: datetime.timedelta
โ€”

The time taken for the complete request/response cycle to complete.

Ais_closed: bool
โ€”

Whether or not the response body has been closed.

method
stream_to_file

Streams the output to the given file.

Accepts a filename or any path-like object, e.g. pathlib.Path