Blackb
Blackb
Project
Report On
Computer Engineering
Submitted by
Supervisor
Mr. Sajid Shaikh
Department of Computer Engineering
Mahatma Education Society’s
Pillai HOC College of Engineering and Technology, Rasayani
(Diploma Section-1148)
Tal: Khalapur, Dist.: Raigad, PIN Code:410207
Academic Year 2023 – 2024
Mahatma Education Society
CERTIFICATE
This is to certify that Mr. Sneha Dadaso Gaikwad from Pillai HOC College
of Engineering and Technology Diploma section (1148) Institute having
Enrollment No. 2111480043 has completed the first phase of the final year
project titled “Voice Assistant Using Python” during the academic year 2023-
2024. The project was completed by a group consisting of 2 Candidates under
the guidance of Mr. Sajid Shaikh.
CERTIFICATE
This is to certify that Mrs. Shreya Puroshattom Phule from Pillai HOC
College of Engineering and Technology Diploma section (1148) Institute
having Enrollment No. 2211480171 has completed the first phase of the final
year project titled “Voice Assistant Using Python ” during the academic year
2023-2024. The project was completed by a group consisting of 2 Candidates
under the guidance of Mr. Sajid Shaikh
We declare that this written submission represents our ideas in our own words and where
other's ideas or words have been included, we adequately cite and reference the original
sources. we also declare that we have adhered to all principles of academic honesty and
integrity and have not misrepresented or fabricated or falsified any idea/data/fact/source in
our submission. we understand that any violation of the above will be cause for disciplinary
action by the Institute and can also evoke penal action from the sources which have thus not
been properly cited or from whom proper permission has not been taken when needed.
Shreya Puroshattom
Phule
(Signatures)
Date:
Index
ACKNOWLEDGEMENT...............................................................................i
ABSTRACT......................................................................................................ii
1 INTRODUCTION.................................................................................1
1.1. DESIGN.........................................................................................3
1.2. VOICE ASSISTANT.....................................................................3
1.3.1 WHAT IS VOICE ASSISTANT................................................3
1.3.2 WHY DO WE NEED IT.............................................................3
1.3.3 WHERE TO USE IT...................................................................3
2 LITERATURE SURVEY...............................................................4
3 METHODOLOGIES........................................................................8
5 CONCLUSION....................................................................................20
REFERENCES...................................................................................23
APPENDICES.....................................................................................24
A. SOURCE CODE.............................................................................24
B. SCREENSHOT...............................................................................30
Voice Assistant using
Python
ACKNOWLEDGEMENT
We would like to take this opportunity to thank one and all that provided their valuable
advice and guidance without which this seminar would not have been completed. We
thank all who have helped me directly or indirectly but some in particular have to be
singled out since they have given me more than just guidance.
We wish to express our deep respect and thankfulness to Mr. Sajid Shaikh , our
project guide. Without his guidance, insightful comments, smart encouragement and
valuable help this work would not have been a success.
We have great pleasure in acknowledging the help we received from all those who
favoured in giving shape to this project, a sincere thanks to all the samples who filled
out our questionnaires.
The Smart people out there who invented the Internet and Google. And obviously our
great teachers.
Computer Engineering
A Voice Assistant is one of the hot topics in the current world that are programs that listens to
human’s verbal command and respond to them which makes it a human computer/device
interaction. In the current days, a voice assistant is everywhere which is a lot useful in these
busy days. Nowadays, almost everyone in the current world is using voice assistant because
it’s everywhere starting from Google smartphone assistant which even 5 years old kids will
know how to use because of the current world pandemic which makes them use smartphones
till Amazon's Alexa which will be very useful to do works starting from entertaining the users
till turning on and off the household products (Internet of Things). One of the greatest
features is that it will be very useful to even physically challenged people, for example,
people who aren't able to walk use the Internet of Things (IoT) feature to operate the
household products and maintain them. So, we tend to develop a voice assistant which will be
very useful to the users same as the other voice assistants which are currently in the world.
CHAPTER NO:1
INTRODUCTION
CHAPTER:1
INTRODUCTION
The very first voice activated product was released in 1922 as Radio Rex. This toy was very simple,
wherein a toy dog would stay inside a dog house until the user exclaimed its name, “Rex” at which point
it would jump out of the house. This was all done by an electromagnet tuned to the frequency similar to
the vowel found in the word Rex, and predated modern computers by over 20 years. In the 21st century,
human interaction is being replaced by automation very quickly. One of the main reasons for this change
is performance. There’s a drastic change in technology rather than advancement. In today’s world, we
train our machines to do their tasks by themselves or to think like humans using technologies like
Machine Learning, Neural Networks, etc. Now in the current era, we can talk to our machines with the
help of virtual assistants. Virtual assistants are software programs that help you ease your day to day
tasks, such as showing weather reports, giving daily news, searching the internet etc. They can take
commands by voice. Voice-based intelligent assistants need an invoking word or wake word to activate
the listener, followed by the command. We have so many virtual assistants, such as Apple’s Siri,
Amazon’s Alexa and Microsoft’s Cortana and Amazon's Alexa and this has been an inspiration for us to
do this as a project. This system is designed to be used efficiently on desktops. Voice assistants are
programs on digital devices that listen and respond to verbal commands. A user can say, “What's the
weather?” and the voice assistant will answer with the weather report for that day and location.
A virtual assistant also called an AI assistant or digital assistant is an application program that
understands natural language voice commands and completes tasks for the user. Voice based personal
assistants have gained a lot of popularity in this era of smart homes and smart devices. These personal
assistants can be easily configured to perform many of your regular tasks by simply giving voice
commands. Google has popularized voice-based search that is a boon for many like senior citizens.
1.1 DESIGN
a) The voice assistant takes an input word which is called as "signal word" to be activated. so, it takes in
the signal word and starts operating for the user commands. b) Converting the speech into text will be
processed by the assistant. c) The converted text is now processed to get the required results. d) The text
given by the user should contain one or two keywords that determine what query is to be executed. If
the keyword doesn’t match any of the queries in the code then the assistant asks the user to speak again.
e) Finally, the output to the user's query will be given by converting speech to text.
1.2VOICE ASSISTANT
Our assistant “Jarvis” extends to helps us when working on a system in which it is installed. We can
access by calling the wake word "Hello Jarvis".
1.3.1 WHAT IS VOICE ASSISTANT A voice assistant, also known as an intelligent personal assistant
or a connected speaker, is a new type of device that is based on natural language speech recognition and
is offered by popular companies like Apple, Amazon, and Google. We got inspired by that and created
one our self.
1.3.2 WHY DO WE NEED IT usually, typing out and searching or doing day-to-day tasks becomes
hectic. But our life doesn’t need to be like that. One can ask for help to voice assistants. They let the
users to perform a task using a speech command, as well as retrieve information via voice synthesis.
CHAPTER NO:2
LITREATURE SURVEY
CHAPTER 2
LITERATURE SURVEY
2.1 RELATED WORK This field of virtual assistants having speech recognition has seen some major
advancements or innovations. This is mainly because of its demand in devices like smart watches or
fitness bands, speakers, Bluetooth earphones, mobile phones, laptop or desktop, television, etc. Almost
all the digital devices which are coming nowadays are coming with voice assistants which help to
control the device with speech recognition only. A new set of techniques is being developed constantly
to improve the performance of voice automated search. As the amount of data is increasing
exponentially now known as Big Data the best way to improve the results of virtual assistants is to
incorporate our assistants with machine learning and train our devices according to their uses. Other
major techniques that are equally important are Artificial Intelligence, Internet of Things, Big Data
access and management, etc. With the use of voice assistants, we can automate the task easily, just give
the input to the machine in the speech form and all the tasks will be done by it from converting your
speech into text form to taking out keywords from that text and execute the query to give results to the
user. Machine Learning is just a subset of Artificial Intelligence. This has been one of the most helpful
advancements in technology. Before AI we were the ones who were upgrading technology to do a task
but now the machine is itself able to counter new tasks and solve it without need to involve the humans
to evolve it. This has been helpful in day-to-day lifestyle. From mobile phones to personal desktops to
mechanical industries these assistants are in very much demand for automating tasks and increasing
efficiency.
2.2 Some Reasons why there is necessity of voice assistants: There are lots of reason why this verbal voice
command application is in need in real time situations. Some of them are given below.
To enable a highly engaging user experience: Voice assistance engages users like no other interface.
Users can speak to the applications naturally to ask for whatever they'd like. To make application
frustration free: We have to touch, type and mouse in the existing machine system to getting our work
done, which are makes user frustrated sometimes. By using voice assistant users can directly ask what
they wanted to get done. To personalize your app experience for every user: Voice assistants are actually
able to respond for every user based on their locality, language and preferences.
Basics fundamental tasks performed by Voice assistants are as follows:
• Search on web
• Play a music or video
CHAPTER NO:3
METHODOLOGY
CHAPTER 3
METHODOLOGY
3.1 EXISTING SYSTEM
From the above literature survey, we have inferred that all the systems existing predict only particular
diseases namely lung disease, breast cancer, heart disease, diabetes by implementing various algorithms
on the particular datasets. After implementing various algorithms, the most accurate one is selected and
it is used for prediction of disease. Sometimes, we may get confused of what algorithm to use. Also, all
the systems find only the particular disease and not the disease based on the symptoms.
3.2 PROPOSED SYSTEM
We are proposing a system in an efficient way of implementing a Personal voice assistant, Speech
Recognition library has many in-built functions, that will let the assistant understand the command
given by user and the response will be sent back to user in voice, with Text to Speech functions. When
assistant captures the voice command given by user, the under lying algorithms will convert the voice
into text and according to the keywords present in the text (command given by user), respective action
will be performed by the assistant. This is made possible with the functions present in different libraries.
Also, the assistant was able to achieve all the functionalities with help of some API’s. We had used
these APIs for functionalities like performing calculations, extracting news from web sources, and for
telling the weather. We will be sending a request, and through the API, we’re getting the respective
output. API’s like WOLFRAMALPHA, are very helpful in performing things like calculations, making
small web searches and for getting the data from web. In this way, we are able to extract news from the
web sources, and send them as input to a function for further purposes. Also, we have libraries like
Random and many other libraries, each corresponding to a different technology.
At the outset we make our program capable of using system voice with the help of sapi5 and pyttsx3.
pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and
is compatible with both Python 2 and 3. The Speech Application Programming Interface or SAPI is an
API developed by Microsoft to allow the use of speech recognition and speech synthesis within Windows
applications. Then we define the speak function to enable the program to speak the outputs. After that we
will define a function to take voice commands using the system microphone. The main function is then
defined where all the capabilities of the program are defined.
Main objective of building personal assistant software (a virtual assistant) is using semantic data sources
available on the web, user generated content and providing knowledge from knowledge databases. The
main purpose of an intelligent virtual assistant is to answer questions that users may have. This may be
done in a business environment, for example, on the business website, with a chat interface. On the
mobile platform, the intelligent virtual assistant is available as a call-button operated service where a
voice asks the user “What can I do for you?” and then responds to verbal input. Virtual assistants can
tremendously save you time. We spend hours in online research and then making the report in our terms
of understanding.
Software Requirements:
Python 3.5 & Above
Windows 7 And Above 3.4.2 Hardware Requirements:
Processor: Intel Core i5
RAM: 4GB
OS: Windows / Mac
Microphone
ARDUINO UNO board
Relay
A Light Bulb
USB Cable
Electronics Wires
Plug Point & a Plug
A microphone is the device that captures audio data from the user and sends it to the system for
processing. A speaker, on the other hand, plays the system's response back to the user. For a voice
assistant AI system, it is important to use a high-quality microphone and speaker to ensure clear and
accurate audio data.
When selecting a microphone and speaker for a voice assistant AI system, it is recommended to choose
a device that is compatible with the system and meets the minimum requirements for recording and
playing back audio data.
2. Memory
Memory, also known as RAM (Random Access Memory), is the temporary storage area used by the
system to store data and instructions. In a voice assistant AI system, memory plays a critical role in
storing audio and video data captured by the microphone and camera, as well as running the AI
algorithms and responding to user queries.
For a voice assistant AI system, it is recommended to use a system with at least 4 GB of RAM.
Additionally, the RAM should have a high clock speed, which can improve the performance of the
system.
3. Storage
Storage, also known as a hard drive or SSD (Solid State Drive), is the permanent storage area used by
the system to store data and files. In a voice assistant AI system, storage is used to store the operating
system, AI algorithms, and other files required for the system to function.
For a voice assistant AI system, it is recommended to use a system with at least 128 GB of storage.
Additionally, it is recommended to use an SSD instead of a hard drive, as SSDs offer faster read and
write speeds, which can improve the overall performance of the system.
4. Processor
The processor, also known as the CPU (Central Processing Unit), is the brain of the computer system. It
is responsible for executing instructions and performing calculations required by the system. In a voice
assistant AI system, the processor plays a critical role in processing audio and video data captured by
the microphone and camera, running the AI algorithms, and responding to user queries.
For a voice assistant AI system, it is recommended to use a high-performance processor with multiple
cores. The number of cores determines the number of tasks the processor can handle simultaneously. A
processor with more cores can handle more tasks simultaneously, which can improve the overall
performance of the system.
Additionally, the clock speed of the processor is also an important factor in the performance of the
system. A higher clock speed means that the processor can execute instructions more quickly, which can
lead to faster response times and better performance.
When selecting a processor for a voice assistant AI system, it is recommended to choose a high-
performance processor with at least 4 cores and a clock speed of at least 2.5 GHz.
Additionally, it is important to ensure that the processor is compatible with the motherboard and other
components of the system.
In conclusion, a high-quality microphone and speaker, sufficient memory and storage, and a high-
performance processor with multiple cores and a high clock speed are the key hardware requirements
for a voice assistant AI system. It is important to choose components that are compatible with each
other and meet the minimum requirements for running voice assistant AI and Python.
3.5.1 PYTHON
Python is an OOPs (Object Oriented Programming) based, high level, interpreted programming
language. It is a robust, highly useful language focused on rapid application development (RAD).
Python helps in easy writing and execution of codes. Python can implement the same logic with as
much as 1/5th code as compared to other OOPs languages. Python provides a huge list of benefits to all.
The usage of Python is such that it cannot be limited to only one activity. Its growing popularity has
allowed it to enter into some of the most popular and complex processes like Artificial Intelligence (AI),
Machine Learning (ML), natural language processing, data science etc. Python has a lot of libraries for
every need of this project. For this project, libraries used are speech recognition to recognize voice,
Pyttsx for text to speech, selenium for web automation etc. It’s owing to the subsequent strengths that
Python has –
Easy to be told and perceive- The syntax of Python is simpler; thence it's comparatively
straightforward, even for beginners conjointly, to be told and perceive the language.
Multi-purpose language − Python could be a multi-purpose programing language as a result of it
supports structured programming, object-oriented programming yet as practical programming.
Support of open supply community − as being open supply programing language, Python is
supported by awfully giant developer community. Because of this, the bugs square measure simply
mounted by the Python community. This characteristic makes Python terribly strong and adaptive.
3.5.2 DOMAIN
The internet of things, or IoT, is a system of interrelated computing devices, mechanical and digital
machines, objects, animals or people that are provided with unique identifiers (UIDs) and the ability to
transfer data over a network without requiring human-to-human or human-to-computer interaction. A
thing in the internet of things can be a person with a heart monitor implant, a farm animal with a biochip
transponder, an automobile that has built in sensors to alert the driver when tire pressure is low or any
other natural or man-made object that can be assigned an Internet Protocol (IP) address and is able to
transfer data over a network. Increasingly, organizations in a variety of industries are using IoT to
operate more efficiently, better understand customers to deliver enhanced customer service, improve
decision-making and increase the value of the business. An IoT ecosystem consists of web-enabled
smart devices that use embedded systems, such as processors, sensors and communication hardware, to
collect, send and act on data they acquire from their environments. IoT devices share the sensor data
they collect by connecting to an IoT gateway or other edge device where data is either sent to the cloud
to be analyzed or analyses locally. Sometimes, these devices communicate with other related devices
and act on the information they get from one another. The devices do most of the work without human
intervention, although people can interact with the devices -- for instance, to set them up, give them
instructions or access the data.
Page 14
Pillai HOC College of Engineering and Technology [Diploma
Section]
Voice Assistant using Python
Flowchart
Page 15
Pillai HOC College of Engineering and Technology [Diploma
Section]
Voice Assistant using Python
CHAPTER NO:4
RESULT AND
DISCUSSION
CHAPTER 4
The project work of the voice assistant has been clearly explained in this report, how useful it is and how
we can rely on a voice assistant for performing any/every task which the user needs to complete and how
the assistant is developing everyday which we can hope that it'll be one of the biggest technology in the
current technological world. Development of the software is almost completed form our side and it's
working fine as expected which was discussed for some extra development. So, maybe some
advancement might come in the near future where the assistant which we developed will be even more
useful than it is now.
4.1. WORKING
It starts with a signal word. Users say the names of their voice assistants for the same reason. They
might say, “Hey Sire!” or simply, “Alexa!” Whatever the signal word is, it wakes up the device. It signals
to the voice assistant that it should begin paying attention. After the voice assistant hears its signal word,
it starts to listen. The device waits for a pause to know you’ve finished your request. The voice assistant
then sends our request over to its source code. Once in the source code, our request is compared to other
requests. It’s split into separate commands that our voice assistant can understand. The source code then
sends these commands back to the voice assistant. Once it receives the commands, the voice assistant
knows what to do next. If it understands, the voice assistant will carry out the task we asked for. For
example, “Hey NOVA! What’s the weather?” NOVA reports back to us in seconds. The more directions
the devices receive, the better and faster they get at fulfilling our requests. The user gives the voice input
through microphone and the assistant is triggered by the wake up word and performs the STT (Speech to
Text) and converts it into a text and understands the Voice input and further performs the task said by the
user repeatedly and delivers it via TTS (Text to Speech) module via AIVoice.
API CALLS
We have used API keys for getting news information from newspaper and weather forecast from open
weather map which can accurately fetch information and give results to the user.
SYSTEM CALLS
In this feature, we have used OS & Web Browser Module to access the desktop, calculator, task
manager, command prompt & user folder. This can also restart the pc and open the chrome application.
CONTENT EXTRATION
This can Perform content extraction from YouTube, Wikipedia and Chrome using the web driver
module from selenium which provides all the implementations for the web drive like searching for a
specific video to play, to get a specific information in Google or from Wikipedia.
SERIAL MODULES
Finally, we used the serial module for implementing the Internet of Things (IOT) feature for this project.
It is a module which acquires the access for the serial port of the Adriano board and used port number
11 and COM3.
CHAPTER NO:5
CONCLUSION
CHAPTER 5
CONCLUON
As stated before, "voice assistant is one of the biggest problem solver" and you can see that in the
proposals with the examples that it is in fact one of the biggest problem solver of the current world. We
can see that voice assistant is one of the major evolving artificial intelligence in the current world once
again on seeing the proposal examples because at the past, the best feature which a voice assistant had
was telling the date and searching the web and giving the results but now look at the functions that it can
do so with this, we can say that it is a evolving software in the current world. The main idea is to develop
the assistant even more advanced than it is now and make it the best air in the world which will save an
ample of time for its users. I would like to conclude with the statement that we will try our best and give
one of the best voice assistants which we are able to. 5.2. FUTURE SCOPE We are entering the era of
implementing voice-activated technologies to remain relevant and competitive. Voice- activation
technology is vital not only for businesses to stay relevant with their target customers, but also for
internal operations. Technology may be utilized to automate human operations, saving time for everyone.
Routine operations, such as sending basic emails or scheduling appointments, can be completed more
quickly, with less effort, and without the use of a computer, just by employing a simple voice command.
People can multitask as a result, enhancing their productivity. Furthermore, relieving employees from
hours of tedious administrative tasks allows them to devote more time to strategy meetings, brainstorming
sessions, and other jobs that need creativity and human interaction.
1) Sending Emails with a voice assistant: Emails, as we all know, are very crucial for communication
because they can be used for any professional contact, and the finest service for sending and receiving
emails is, as we all know, GMAIL. Gmail is a Google-created free email service. Gmail can be accessed
over the web or using third-party apps that use the POP or IMAP protocols to synchronize email
content. To integrate Gmail with Voice Assistant we have to utilize Gmail API. The Gmail API allows
you to access and control threads, messages, and labels in your Gmail mailbox.
2) Scheduling appointments using a voice assistant: The demands on our time increase as our company
grows. A growing number of people want to meet with us. We have a growing number of people who
rely on us. We must check in on certain projects or set aside time to chat with possible business leads.
There won't be enough hours in the day if we keep doing things the old way. We need to get a better
handle on our full-time schedule and devise a strategy for arranging appointments that doesn't interfere
with our most critical job. By working with a virtual scheduler or, in other words, a virtual assistant, we
let someone else worry about the organization and prioritize our schedule while we focus on the work.
3) Improved Interface of a voice assistant (VUI): Voice user interfaces (VUIs) allow users to interact
with a system by speaking commands. VUIs include virtual assistants like Amazon's Alexa and Apple's
Sire. The real advantage of a VUI is that it allows users to interact with a product without using their
hands or their eyes while focusing on anything else. -Other benefits of a Voice user interface (VUI):
Speed and Efficiency: Hands-free interactions are possible with VUIs. This method of interaction
eliminates the need to click buttons or tap on the screen. The major means of human communication is
speech. People have been using speech to form relationships for ages. As a result, solutions that allow
customers to do the same are extremely valuable. Furthermore, even for experienced testers, dictating
text messages has been demonstrated to be faster than typing. Hands-free interactions, at least in some
circumstances, save time and boost efficiency. Intuitiveness and convenience: Intuitive user flow is
required of high-quality VUIs, and technical advancements are expected to continue to improve the
intuitiveness of voice interfaces. Compared to graphical UIs, VUIs require less cognitive effort from the
user. Furthermore, everyone – from a small child to your grandmother – can communicate. As a result,
VUI designers are in a better position than GUI designers, who run the danger of producing
incomprehensible menus and exposing users to the agony of poor interface design. Customers are
unlikely to need to be instructed on how to utilize the technology by VUI makers. People can instead
ask their voice assistant for assistance.
REFERENCES
[1] K. Noda, H. Arie, Y. Suga, T. Ogata, Multimodal integration learning of robot behavior using deep
neural networks, Elsevier: Robotics and Autonomous Systems, 2014.
[3] Deepak Sheened, RiaUmahiya, Monika Ragwort, AishwaryaBhisikar, AnupBhange, “AI Based
Voice Assistant Using Python”, Journal of Emerging Technologies and Innovative Research (JETIR),
February 2019, Volume 6, Issue 2.
[4] J. B. Allen, “From lord Rayleigh to Shannon: How do humans decode speech,” in International
Conference on Acoustics, Speech and Signal Processing, 2002.
[6] B.H. Juan and Lawrence R. Rainer, “Automatic Speech Recognition - A Brief History of the
Technology Development”.
Appendix
A. Source Code
def speak(audio):
"""Function to speak given text."""
engine.say(audio)
engine.runAndWait()
def wishMe():
"""Function to greet the user based on the time of day."""
hour = datetime.datetime.now().hour
if 0 <= hour < 12:
speak("Good Morning!")
elif 12 <= hour < 18:
speak("Good Afternoon!")
else:
speak("Good Evening!")
speak("I am your Assistant. How can I help you?")
def takeCommand():
"""Function to recognize user's voice command."""
recognizer = sr.Recognizer()
with sr.Microphone() as source:
print("Listening...")
recognizer.pause_threshold = 1
audio = recognizer.listen(source)
try:
print ("Recognizing...")
query = recognizer.recognize_google(audio, language='en-
in') print(f"User said: {query}\n")
except Exception as
e:
Print(e)
print ("Unable to Recognize your voice.")
return "None"
return query.lower()
if _name_ == '_main_':
clear = lambda:
os.system('cls') clear()
wishMe()
while True:
query = takeCommand()
if 'wikipedia' in query:
speak('Searching Wikipedia...')
query = query.replace("wikipedia", "")
results = wikipedia.summary(query, sentences=3)
Speak("According to Wikipedia")
Speak(results)
webbrowser. Open("https://www.youtube.com/")
webbrowser.open("https://www.amazon.in/s?i=kitchen&bbn=4286640031&rh=n%3A4286640031%2C
p_36%3A3444810031%2Cp_90%3A20912642031%2Cp_72%3A1318476031&dc&ds=v1%3A7NcuZ
Nyg3Jeoot3BN%2FynB7qHIRuX3MPO%2F6yAIFkH8y0&_encoding=UTF8&content-
id=amzn1.sym.7125bb39-e5c5-437d-827a-8ad948d7f157&pd_rd_r=3d5f5fe2-fe16-4004-94ad-
7bfdd4a8b86a&pd_rd_w=jC1ED&pd_rd_wg=eltQW&pf_rd_p=7125bb39-e5c5-437d-827a-
8ad948d7f157&pf_rd_r=MBGQNGC1T6GKRMEASSKC&qid=1711132165&rnid=1318475031&ref=
sr_nr_p_72_1")
elif "calculate" in
query: try:
import wolframalpha
except Exception as e:
print("An error occurred:",
e)
speak("Sorry, I couldn't calculate the answer.")
OUTPUT