Comments (5)
If you are looking to make it as web application then checkout example Django application https://github.com/ahmadfaizalbh/WebBot
If you want to help you with the creating middleware, I would need more information about what kind of middleware you are looking at, how you want the middleware to function, in which language your application runs, etc.
if you don't want to disclose details here you can always email me at [email protected]
from chatbot.
I actually need to pass all the response of the chatbot to a text to speech engine.
Language: Python 3
def speak(msg):
# I run a command here to trigger a script for text to speech
Please note: every thing is running smoothly there are no issues.
But I can't a way to obtain every response of the chatbot. Is there a way to do that?
Thanks.
from chatbot.
You can in inherit Chat and override conversation
from chatbot import Chat
class MyChat(Chat):
def converse(self, first_question=None, quit="quit", session_id="general"):
"""
Conversation initiator
:type first_question: str
:param first_question: Start up message
:type quit: str
:param quit: Conversation termination command
:type session_id: str
:param session_id: Current User session when used for multi user scenario
:rtype: str
"""
if first_question:
self.conversation[session_id].append(first_question)
speak(first_question)
input_sentence = ""
while input_sentence != quit:
# Read Input source
input_sentence = input("> ")
if input_sentence:
self.conversation[session_id].append(input_sentence)
input_sentence = input_sentence.rstrip("!.")
message = self.respond(input_sentence, session_id=session_id)
self.conversation[session_id].append(message)
# call output function
speak(message)
first_question = "Hi, how are you?"
chat = MyChat(os.path.join(os.path.dirname(os.path.abspath(__file__)), "Example.template"))
chat.converse(first_question)
if you have any voice listener function that returns user text then replace input
with listener function
from chatbot.
Oh okay! I'll give it a try and get back to you. Thanks
from chatbot.
Thanks dude 👍 It worked just fine.
I have another question I'll open another issue for that.
from chatbot.
Related Issues (20)
- Where is Chat, register_call functions? HOT 2
- Execution HOT 9
- Functions registered via register_call can not access variables HOT 4
- Add examples for features in template files HOT 2
- Can not call function without parameters HOT 1
- Can not avoid "default" answers from default.template HOT 3
- Get confidence score for selected answer HOT 4
- Load all templates from a folder HOT 5
- Access variables from python code HOT 1
- Is the installation from PIP up to date?
- A more detailed explanation of Topic based group,Learn HOT 3
- How i can get the text of the response of the bot? HOT 3
- Any more details document? HOT 2
- Learning by chatting HOT 7
- Chat not found HOT 1
- HI HOT 1
- Plugin System HOT 1
- conditional Chatbot response
- Traceback (most recent call last): HOT 11
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatbot.