This pull request to sdk/js/packages/client/src/client.ts includes changes to improve the request preparation process and streamline the code. The most important changes include adding a new utility function for converting operation options to request parameters, refactoring the request preparation logic, and simplifying the request handling in the AIChatProtocolClient class.
sdk/js/packages/client/src/client.ts: Refactored the prepareRequest method to use the new operationOptionsToRequestParameters utility function and simplified the logic for setting contentType and body properties. [1][2][3]
Simplification of request handling:
sdk/js/packages/client/src/client.ts: Removed the options parameter from the post method calls in sendMessage and sendMessageAsStream methods to simplify the request handling. [1][2]
This pull request to
sdk/js/packages/client/src/client.ts
includes changes to improve the request preparation process and streamline the code. The most important changes include adding a new utility function for converting operation options to request parameters, refactoring the request preparation logic, and simplifying the request handling in theAIChatProtocolClient
class.Improvements to request preparation:
sdk/js/packages/client/src/client.ts
: AddedoperationOptionsToRequestParameters
to the import statement.sdk/js/packages/client/src/client.ts
: Refactored theprepareRequest
method to use the newoperationOptionsToRequestParameters
utility function and simplified the logic for settingcontentType
andbody
properties. [1] [2] [3]Simplification of request handling:
sdk/js/packages/client/src/client.ts
: Removed theoptions
parameter from thepost
method calls insendMessage
andsendMessageAsStream
methods to simplify the request handling. [1] [2]