Python Binding for Cody Agent from Sourcegraph: JSON-RPC over TCP or stdio. Establish seamless connectivity with the Cody Agent using this Python binding. Leverage the power of JSON-RPC over TCP or stdio for efficient communication.
MIT License
19
stars
6
forks
source link
fix: Convert JSON message to bytes in _send_jsonrpc_request #11
The _send_jsonrpc_request function in messaging.py has been updated to handle unicode input from the user, such as non-ASCII characters. The following changes have been made:
Convert the JSON message to bytes using pd.to_json(message) instead of decoding it to a string.
Create the content message as bytes by encoding the content length header and concatenating it with the JSON message bytes.
Write the content message bytes directly to the writer instead of encoding it again.
These modifications ensure that the function can properly send messages containing unicode characters to the server without any encoding issues and closes issue Handling non-ascii characters #10 .
The
_send_jsonrpc_request
function inmessaging.py
has been updated to handle unicode input from the user, such as non-ASCII characters. The following changes have been made:pd.to_json(message)
instead of decoding it to a string.These modifications ensure that the function can properly send messages containing unicode characters to the server without any encoding issues and closes issue Handling non-ascii characters #10 .