MCPcopy
hub / github.com/crewAIInc/crewAI / _patched_from_serialized_response

Function _patched_from_serialized_response

conftest.py:173–185  ·  view source on GitHub ↗

Patched version that ensures response._content is properly set.

(
        request: Any, serialized_response: Any, history: Any = None
    )

Source from the content-addressed store, hash-verified

171 _from_serialized: Any = _original_from_serialized_response
172
173 def _patched_from_serialized_response(
174 request: Any, serialized_response: Any, history: Any = None
175 ) -> Any:
176 """Patched version that ensures response._content is properly set."""
177 response = _from_serialized(request, serialized_response, history)
178 # Explicitly set _content to avoid ResponseNotRead errors
179 # The content was passed to the constructor but the mocked read() prevents
180 # proper initialization of the internal state
181 body_content = serialized_response.get("body", {}).get("string", b"")
182 if isinstance(body_content, str):
183 body_content = body_content.encode("utf-8")
184 response._content = body_content
185 return response
186
187 httpx_stubs._from_serialized_response = _patched_from_serialized_response
188

Callers

nothing calls this directly

Calls 1

getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…