Closed pyrooka closed 1 year ago
The changes in this PR will require an SDK user to change their code in terms of how a string-based response is received. The app will no longer need to explicitly access the text
field of the response, since that's what's now being set in the "result" field. This constitutes a breaking change from the perspective of an app using a Python SDK.
We'll need to tread very carefully here and consider the ramifications of this change.
cc: @dpopp07
Agree, we should be careful. I treat this PR as a POC for now due to the breaking change it introduces.
We agreed on not to merge this feature due to the breaking changes and keep the current behavior, so I'm closing this PR now but won't delete the feature branch in case of we need it in the future.
In case of text responses like
text/plain
,text/html
, etc... thesend
method returns the whole response object as the result in theDetailedResponse
object. This PR changes this behavior so that thesend
method will return the response text from the body as string. It means it can be accessed directly from the response by callingresponse.get_result()
.