0% found this document useful (0 votes)
58 views

Project Testing

This document appears to be a project report for a Voice Assistant created using Python and the OpenAI API. It includes a certificate page, acknowledgements, table of contents, an introduction to the project describing the Voice Assistant and its capabilities, an introduction to Python programming language, coding sections showing the Python code used, an output section, and bibliography. The project utilizes Python, PyTTSX3 for text-to-speech, speech recognition with the Google API, and the OpenAI API to build an intelligent voice assistant that can understand natural language commands.

Uploaded by

Jujhar Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views

Project Testing

This document appears to be a project report for a Voice Assistant created using Python and the OpenAI API. It includes a certificate page, acknowledgements, table of contents, an introduction to the project describing the Voice Assistant and its capabilities, an introduction to Python programming language, coding sections showing the Python code used, an output section, and bibliography. The project utilizes Python, PyTTSX3 for text-to-speech, speech recognition with the Google API, and the OpenAI API to build an intelligent voice assistant that can understand natural language commands.

Uploaded by

Jujhar Singh
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Voice Assistant

24.01.2023
!

Jujhar Singh
Class XI-D
Roll No. :-32
Shri Guru Gobind Singh Public School
1

Certificate

This is to certify that the ……Voice


Assistant Project…….. is submitted by
………Jujhar Singh……. under the
supervision of …..(your teacher’s
name)……in the academic year…..2022-
2023……….

Sign of teacher Sign of external


2

Acknowledgement

I would like to convey my heartfelt


gratitude to Mrs. (Teacher’s Name) for
her tremendous support and
assistance in the completion of my
project. I would also like to thank our
Principal, Mrs. Pritinder Kaur for
providing me with this wonderful
opportunity to work on a project with
the topic Food Culture during the
Pandemic. The completion of the
project would not have been possible
without their help and insights.
3

Table Of Contents
Certificate . . . . . . . . . . . . . . . 1

Acknowledgement . . . . . . . . . . . . . 2

Introduction to Project . . . . . . . . . 4

Introduction to Python . . . . . . . . . 5

Coding . . . . . . . . . . . . . . . . . 6

Output . . . . . . . . . . . . . . . . . 8

Bibliography . . . . . . . . . . . . . . 10
4

Introduction To Project
"Introducing the Voice Assistant project, where we
utilized the power of Python and the OpenAI API to
create a cutting-edge virtual assistant. With this project,
users can interact with the assistant using natural
language commands to perform various tasks such as
setting reminders, playing music, and answering
questions. The integration of the OpenAI API allows for
advanced language processing capabilities, making the
Voice Assistant highly responsive and accurate. The
project was designed to be user-friendly, with a simple
and intuitive interface. Overall, this project demonstrates
the potential of combining Python and the OpenAI API to
create powerful, AI-driven applications."
5

Introduction To Python

Python is a popular, high-level programming language


known for its readability and simplicity. It is a versatile
language that can be used for a wide variety of tasks, from
web development and data analysis to artificial
intelligence and scientific computing. Some key features
of Python include its easy-to-learn syntax, its large and
active community, and the vast collection of libraries and
frameworks available for use. To get started with Python,
you will need a text editor or an integrated development
environment (IDE) to write and run your code. Some
popular options include IDLE (which comes pre-installed
with Python), PyCharm, and Visual Studio Code.
6

Coding
MAIN.PY :-

import openai
import pyttsx3
import speech_recognition as sr
from api_key import API_KEY

openai.api_key = API_KEY

engine = pyttsx3.init()

r = sr.Recognizer()
mic = sr.Microphone()

conversation = ""
user_name = "Jujhar"
bot_name = "Quartic"

while True:
with mic as source:
print("\nlistening...")
r.adjust_for_ambient_noise(source, duration=0.2)
audio = r.listen(source)
print("no longer listening.\n")

try:
user_input = r.recognize_google(audio)
except:
continue

prompt = user_name + ": " + user_input + "\n" + bot_name + ": "

conversation += prompt # allows for context

# fetch response from open AI api


7

response = openai.Completion.create(
engine='text-davinci-003', prompt=conversation, max_tokens=100)
response_str = response["choices"][0]["text"].replace("\n", "")
response_str = response_str.split(
user_name + ": ", 1)[0].split(bot_name + ": ", 1)[0]

conversation += response_str + "\n"


print(response_str)

engine.say(response_str)
engine.runAndWait()

api_key.py :-

API_KEY = "{Confidential}"

8

Output
9


10

Bibliography
1. GitHub. (2021). GitHub. Retrieved from https://github.com/

2. PyPI. (2021). PyPI - the Python Package Index. Retrieved from


https://pypi.org/

3. Microsoft. (2021). Visual Studio Code. Retrieved from


https://code.visualstudio.com/

4. OpenAI. (2021). OpenAI. Retrieved from https://openai.com/

5. OpenAI. (2021). GPT-3. Retrieved from https://openai.com/gpt-3/

You might also like