-
Notifications
You must be signed in to change notification settings - Fork 1
Home
Welcome to the chatbox wiki lab members. Programming Roles:
Aliya: Work out how to get the chatbot to detect questions and greetings through keywords (implement into coding). Input(1)
Abdullah: Work out how to get the code to connect to an API (implement into coding). Input(2)
Clark: Work out how the chatbot should respond to a user's mood and how it'll detect how comfortable a user feels with the advice they're given. Input(3)
Daniel: Include exceptions where a user enters an integer and/or a float instead of a string. (implement into coding). Input(5)
Darian: Work out how the chatbot will pull links from external websites/ work out how the chatbot can display information from external websites in a distinctive format (implement into coding). Input(4)
Uwais: Work out how the chatbot can develop more natural and unique responses according to a user's input over time. (implement into coding). Input(6)
Directory: Moodle > Other Modules > Computer Science > Activity Led Learning Project 1 > Basic Client/Server Code - Message Passing.
Sample Code For Client-Server ChatBot using Python.
The client-server ChatBot currently makes use of two python files.
Server_code.py and Client_code.py.
This server (ChatBot) is able to receive messages from the user (client) and also send the same message back to the user (client).
The server code creates a socket and sits there waiting for the client to connect to it. Once the server and client are connected the client can pass a message to the server. The server will receive the message and then send a message back. Currently, the message back is not related to the one received from the user, but your chatbot (server) will need to respond in an appropriate manner.
The client code creates a socket and connects to the server based on the host IP and port values supplied by the server.
Client code has a while loop so the client and server can have a long conversation. The loop will print the information from the server (ChatBot) and then allow the user to respond.
The user can end the conversation by typing end.
Running the Code
You’ll need to run the code in two different IDLE instances.
First of all, you run the server code followed by the client.
Once you get this code working, you will need to start changing it to create your groups fully functioning ChatBot.