mary-africa / converse

Making conversational agents - one step at a time.
2 stars 1 forks source link

Create `ConverseAgent` object #5

Closed iam-kevin closed 3 years ago

iam-kevin commented 3 years ago

Remove using the Responder and encode function, interface using the ConverseAgent object

Example:

const ddo = require('./hotel.ddo`)
const agent = HTTPConverseAgent(ddo)

app.post((req, res) => {
   const { message, state } = req.body
   const response = agent.respond({ message, state })
   res.send(response).status(200)
})

The interfaces for the converse agent should be for both HTTP and WebSocket interfaces

iam-kevin commented 3 years ago

See commit d072d732b99dbda4db9dd4dca43b42a4e7b5aeda

iam-kevin commented 3 years ago

Implementation for the HTTP and WebSocket version should be done on the server using the sockets for now as a way around.