Creating a Chatbot using python prtobuf and grpc
Protobuf is used to serialize a message while sending data over network, this file is using GRPC to send data from client to server.
Windows, OS X & Linux::
Install requirements ($ pip3 install -r requirements.txt)
Note: In case if installation doesn't work check protobuf installation for your Operating system.
This can be used to send the serialized data over network which is faster as compared to other serialization.
Code example:
Navigate to my_work folder and run this code to create bindings
python -m grpc_tools.protoc -I. --python_out=. --grpc_python_out=. chatbot.proto
Now open two shell and run the below code in two different shell
python client.py
python server.py
Output example:
Enter your message: good afternoon # Client Request
good afternoon, how you doing # Server Response
Shankar Jha – @Skhk634 – [email protected]
Distributed under the mit license. See LICENSE
for more information.
https://github.com/shankarj67/GRPC-Hackathon
- Fork it (https://github.com/shankarj67/GRPC-Hackathon)
- Create your feature branch (
git checkout -b feature/fooBar
) - Commit your changes (
git commit -am 'Add some fooBar'
) - Push to the branch (
git push origin feature/fooBar
) - Create a new Pull Request