mirror of
https://github.com/bentoml/OpenLLM.git
synced 2026-03-06 08:08:03 -05:00
feat(client): support return response_cls to string (#614)
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
This commit is contained in:
@@ -134,6 +134,9 @@ class APIResponse(t.Generic[Response]):
|
||||
stream_cls = self._stream_cls or self._client._default_stream_cls
|
||||
return stream_cls(response_cls=self._response_cls, response=self._raw_response, client=self._client)
|
||||
|
||||
if self._response_cls is str:
|
||||
return self._raw_response.text
|
||||
|
||||
content_type, *_ = self._raw_response.headers.get('content-type', '').split(';')
|
||||
if content_type != 'application/json':
|
||||
# Since users specific different content_type, then we return the raw binary text without and deserialisation
|
||||
|
||||
Reference in New Issue
Block a user