diff --git a/libs/sdk-py/langgraph_sdk/client.py b/libs/sdk-py/langgraph_sdk/client.py index 3fbf61041..d6c5b6f05 100644 --- a/libs/sdk-py/langgraph_sdk/client.py +++ b/libs/sdk-py/langgraph_sdk/client.py @@ -298,9 +298,7 @@ async def stream( logger.error(f"Error from langgraph-api: {body}", exc_info=e) raise e # check content type - content_type = self._response.headers.get("content-type", "").partition( - ";" - )[0] + content_type = res.headers.get("content-type", "").partition(";")[0] if "text/event-stream" not in content_type: raise httpx.TransportError( "Expected response header Content-Type to contain 'text/event-stream', " @@ -2447,9 +2445,7 @@ def stream( logger.error(f"Error from langgraph-api: {body}", exc_info=e) raise e # check content type - content_type = self._response.headers.get("content-type", "").partition( - ";" - )[0] + content_type = res.headers.get("content-type", "").partition(";")[0] if "text/event-stream" not in content_type: raise httpx.TransportError( "Expected response header Content-Type to contain 'text/event-stream', "