├── .DS_Store
├── .github
├── .DS_Store
├── CODEOWNERS
├── ISSUE_TEMPLATE
│ ├── bug_report.yml
│ ├── config.yml
│ ├── documentation.yml
│ ├── feature_request.yml
│ └── other.yml
├── pull_request_template.md
└── workflows
│ ├── assign-yourself.yml
│ ├── codeql-analysis.yml
│ ├── pull-request-automation.yml
│ └── standard-labels.yml
├── .gitignore
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── app.py
├── backend
├── __init__.py
├── __pycache__
│ ├── location.cpython-38.pyc
│ ├── music.cpython-38.pyc
│ ├── search.cpython-38.pyc
│ ├── speak.cpython-38.pyc
│ └── weather.cpython-38.pyc
├── chat.py
├── core.py
├── location.py
├── news.py
├── password.py
├── record.py
├── search.py
├── speak.py
├── speech.py
├── story.py
└── weather.py
├── images
├── Source.ico
├── Source.png
└── ss.png
├── renovate.json
├── requirements.txt
└── templates
├── index.html
├── no_internet.gif
└── style.css
/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/.DS_Store
--------------------------------------------------------------------------------
/.github/.DS_Store:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/.github/.DS_Store
--------------------------------------------------------------------------------
/.github/CODEOWNERS:
--------------------------------------------------------------------------------
1 | * @J-dogcoder
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/bug_report.yml:
--------------------------------------------------------------------------------
1 | name: Bug report
2 | description: Create a report to help us address an error.
3 | title: "[BUG] - "
4 | labels: ["🐛 bug 🐛", "priority: critical", "🧹 status: ticket work required 🧹", 🚦 status: awaiting triage 🚦]
5 | assignees: "j-dogcoder"
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: '# Bug report'
10 | - type: textarea
11 | id: bugdescription
12 | attributes:
13 | label: What bug did you encounter?
14 | description: |
15 | Please provide a clear description of the bug.
16 |
17 | Include the steps you took to cause the bug, and an explanation of what occurred.
18 | validations:
19 | required: true
20 | - type: textarea
21 | id: behaviour
22 | attributes:
23 | label: What did you expect to happen?
24 | description: What did you expect to happen instead of the current behaviour?
25 | validations:
26 | required: true
27 | - type: textarea
28 | id: screenshots
29 | attributes:
30 | label: Screenshots
31 | description: Attach any relevant screenshots here.
32 | validations:
33 | required: false
34 | - type: textarea
35 | id: extrainformation
36 | attributes:
37 | label: Additional information
38 | description: Is there anything else we should know about this bug?
39 | validations:
40 | required: false
41 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/documentation.yml:
--------------------------------------------------------------------------------
1 | name: Documentation
2 | description: Request an update to invalid/outdated documentation
3 | title: "[DOC] - "
4 | labels: ["🧹 status: ticket work required 🧹", "priority: medium", " 📖 documentation 📖", 🚦 status: awaiting triage 🚦]
5 | assignees: "j-dogcoder"
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: "# Incorrect Documentation"
10 | - type: textarea
11 | id: docerrordescription
12 | attributes:
13 | label: What is incorrect in the documentation?
14 | description: Please explain the information that is incorrect in the documentation, and why you think it needs to be updated.
15 | validations:
16 | required: true
17 | - type: textarea
18 | id: expectedinformation
19 | attributes:
20 | label: What should that text say?
21 | description: Provide the information that the documentation should actually contain instead of the incorrect content.
22 | validations:
23 | required: true
24 | - type: textarea
25 | id: extrainfo
26 | attributes:
27 | label: Additional information
28 | description: Is there anything else we should know about this inaccuracy?
29 | validations:
30 | required: false
31 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/feature_request.yml:
--------------------------------------------------------------------------------
1 | name: Feature request
2 | description: Suggest an idea for this project
3 | title: "[FEAT] - "
4 | labels: ["🚦 status: awaiting triage 🚦", "🧹 status: ticket work required 🧹", "✨ Feature Request ✨",]
5 | assignees: "j-dogcoder"
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: "# Feature request"
10 | - type: textarea
11 | id: feature
12 | attributes:
13 | label: What feature would you like to see?
14 | description: Be as detailed as possible here. What would you like this application to do? How should you, as a user, interact with this feature?
15 | - type: textarea
16 | id: extrainfo
17 | attributes:
18 | label: Additional information
19 | description: Is there anything else we should know about this feature?
20 | validations:
21 | required: false
22 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/other.yml:
--------------------------------------------------------------------------------
1 | name: Other
2 | description: Use this for any other issues. PLEASE do not create blank issues
3 | title: "[OTHER] - "
4 | labels: ["🚦 status: awaiting triage 🚦", "🧹 status: ticket work required 🧹","🚧 status: blocked 🚧",]
5 | assignees: "j-dogcoder"
6 | body:
7 | - type: markdown
8 | attributes:
9 | value: "# Other issue"
10 | - type: textarea
11 | id: issuedescription
12 | attributes:
13 | label: What would you like to share?
14 | description: Provide a clear and concise explanation of your issue.
15 | validations:
16 | required: true
17 | - type: textarea
18 | id: extrainfo
19 | attributes:
20 | label: Additional information
21 | description: Is there anything else we should know about this issue?
22 | validations:
23 | required: false
24 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 | # Pull Request
2 |
3 |
4 |
5 | ## Description
6 |
7 |
8 |
9 | ## Related Issue
10 |
11 |
12 |
13 | Closes #XXXXX
14 |
15 | ## Scope
16 |
17 | Did you remember to update the `package.json` version number?
18 |
19 | - [ ] Major Version Update: X.\_.\_ (for complete code refactors, or large PRs that adjust most of the codebase)
20 | - [ ] Minor Version Update: \_.X.\_ (for the addition of new commands)
21 | - [ ] Patch Version Update: \_.\_.X (for bug fixes _in the code_.)
22 | - [ ] No Version Update: \_.\_.\_ (no version update for additions to tests, documentation, or anything that isn't end-user facing.)
23 |
24 | ## Documentation
25 |
26 | For _any_ version updates, please verify if the documentation page needs an update. If it does, please create an issue to ensure it is not forgotten.
27 |
28 | - [ ] My contribution does NOT require a documentation update.
29 | - [ ] My contribution DOES require a documentation update.
30 |
--------------------------------------------------------------------------------
/.github/workflows/assign-yourself.yml:
--------------------------------------------------------------------------------
1 | name: Assign
2 | on:
3 | issue_comment:
4 |
5 | jobs:
6 | one:
7 | runs-on: ubuntu-latest
8 | steps:
9 | # .take in an issue comment.
10 | - name: take an issue
11 | uses: bdougie/take-action@main
12 | env:
13 | GITHUB_TOKEN: ${{ github.token }}
14 |
--------------------------------------------------------------------------------
/.github/workflows/codeql-analysis.yml:
--------------------------------------------------------------------------------
1 | # For most projects, this workflow file will not need changing; you simply need
2 | # to commit it to your repository.
3 | #
4 | # You may wish to alter this file to override the set of languages analyzed,
5 | # or to provide custom queries or build logic.
6 | #
7 | # ******** NOTE ********
8 | # We have attempted to detect the languages in your repository. Please check
9 | # the `language` matrix defined below to confirm you have the correct set of
10 | # supported CodeQL languages.
11 | #
12 | name: "CodeQL"
13 |
14 | on:
15 | push:
16 | branches: [ master ]
17 | pull_request:
18 | # The branches below must be a subset of the branches above
19 | branches: [ master ]
20 | schedule:
21 | - cron: '24 10 * * 1'
22 |
23 | jobs:
24 | analyze:
25 | name: Analyze
26 | runs-on: ubuntu-latest
27 | permissions:
28 | actions: read
29 | contents: read
30 | security-events: write
31 |
32 | strategy:
33 | fail-fast: false
34 | matrix:
35 | language: [ 'python' ]
36 | # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
37 | # Learn more:
38 | # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
39 |
40 | steps:
41 | - name: Checkout repository
42 | uses: actions/checkout@v2
43 |
44 | # Initializes the CodeQL tools for scanning.
45 | - name: Initialize CodeQL
46 | uses: github/codeql-action/init@v1
47 | with:
48 | languages: ${{ matrix.language }}
49 | # If you wish to specify custom queries, you can do so here or in a config file.
50 | # By default, queries listed here will override any specified in a config file.
51 | # Prefix the list here with "+" to use these queries and those in the config file.
52 | # queries: ./path/to/local/query, your-org/your-repo/queries@main
53 |
54 | # Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
55 | # If this step fails, then you should remove it and run the build manually (see below)
56 | - name: Autobuild
57 | uses: github/codeql-action/autobuild@v1
58 |
59 | # ℹ️ Command-line programs to run using the OS shell.
60 | # 📚 https://git.io/JvXDl
61 |
62 | # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
63 | # and modify them (or add more) to build your code if your project
64 | # uses a compiled language
65 |
66 | #- run: |
67 | # make bootstrap
68 | # make release
69 |
70 | - name: Perform CodeQL Analysis
71 | uses: github/codeql-action/analyze@v1
72 |
--------------------------------------------------------------------------------
/.github/workflows/pull-request-automation.yml:
--------------------------------------------------------------------------------
1 | name: Automatic pull request review
2 | on: [pull_request]
3 | jobs:
4 | automate-pullrequest-review:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - name: Approve pull request
8 | if: github.actor == 'j-dogcoder'
9 | uses: andrewmusgrave/automatic-pull-request-review@0.0.5
10 | with:
11 | repo-token: ${{ secrets.GITHUB_TOKEN }}
12 | event: APPROVE
13 |
--------------------------------------------------------------------------------
/.github/workflows/standard-labels.yml:
--------------------------------------------------------------------------------
1 | name: Import standard labels
2 |
3 | on:
4 | push:
5 | branches: [ master ]
6 |
7 | jobs:
8 | labels:
9 |
10 | runs-on: ubuntu-latest
11 |
12 | steps:
13 | - uses: actions/setup-node@v2
14 | with:
15 | node-version: '14'
16 | - uses: j-dogcoder/gh-action-labels@main
17 | with:
18 | github-token: ${{ secrets.GITHUB_TOKEN }}
19 | owner-name: 'j-dogcoder'
20 | repository-name: 'AI'
21 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Byte-compiled / optimized / DLL files
2 | __pycache__/
3 | *.py[cod]
4 | *$py.class
5 |
6 | # C extensions
7 | *.so
8 |
9 | # Distribution / packaging
10 | .Python
11 | build/
12 | develop-eggs/
13 | dist/
14 | downloads/
15 | eggs/
16 | .eggs/
17 | lib/
18 | lib64/
19 | parts/
20 | sdist/
21 | var/
22 | wheels/
23 | pip-wheel-metadata/
24 | share/python-wheels/
25 | *.egg-info/
26 | .installed.cfg
27 | *.egg
28 | MANIFEST
29 |
30 | # PyInstaller
31 | # Usually these files are written by a python script from a template
32 | # before PyInstaller builds the exe, so as to inject date/other infos into it.
33 | *.manifest
34 | *.spec
35 |
36 | # Installer logs
37 | pip-log.txt
38 | pip-delete-this-directory.txt
39 |
40 | # Unit test / coverage reports
41 | htmlcov/
42 | .tox/
43 | .nox/
44 | .coverage
45 | .coverage.*
46 | .cache
47 | nosetests.xml
48 | coverage.xml
49 | *.cover
50 | *.py,cover
51 | .hypothesis/
52 | .pytest_cache/
53 |
54 | # Translations
55 | *.mo
56 | *.pot
57 |
58 | # Django stuff:
59 | *.log
60 | local_settings.py
61 | db.sqlite3
62 | db.sqlite3-journal
63 |
64 | # Flask stuff:
65 | instance/
66 | .webassets-cache
67 |
68 | # Scrapy stuff:
69 | .scrapy
70 |
71 | # Sphinx documentation
72 | docs/_build/
73 |
74 | # PyBuilder
75 | target/
76 |
77 | # Jupyter Notebook
78 | .ipynb_checkpoints
79 |
80 | # IPython
81 | profile_default/
82 | ipython_config.py
83 |
84 | # pyenv
85 | .python-version
86 |
87 | # pipenv
88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies
90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not
91 | # install all needed dependencies.
92 | #Pipfile.lock
93 |
94 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow
95 | __pypackages__/
96 |
97 | # Celery stuff
98 | celerybeat-schedule
99 | celerybeat.pid
100 |
101 | # SageMath parsed files
102 | *.sage.py
103 |
104 | # Environments
105 | .env
106 | .venv
107 | env/
108 | venv/
109 | ENV/
110 | env.bak/
111 | venv.bak/
112 |
113 | # Spyder project settings
114 | .spyderproject
115 | .spyproject
116 |
117 | # Rope project settings
118 | .ropeproject
119 |
120 | # mkdocs documentation
121 | /site
122 |
123 | # mypy
124 | .mypy_cache/
125 | .dmypy.json
126 | dmypy.json
127 |
128 | # Pyre type checker
129 | .pyre/
130 |
--------------------------------------------------------------------------------
/CONTRIBUTING.md:
--------------------------------------------------------------------------------
1 | Since it is a free software , you can contribute to make it better. New contributors are always welcome, whether you write code, create resources, report bugs, or suggest features.
2 |
3 | Frontend- The frontend of J.A.R.V.I.S is written using html and css. If you want to improve the frontend go to the templates folder and make the changes you want but remember to include a screenshot when you create a pull request
4 |
5 | Backend- The backend of J.A.R.V.I.S is written using python3. If you want to improve the backend go to the backend folder and make the changes you want
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Eclipse Public License - v 2.0
2 |
3 | THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE
4 | PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
5 | OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
6 |
7 | 1. DEFINITIONS
8 |
9 | "Contribution" means:
10 |
11 | a) in the case of the initial Contributor, the initial content
12 | Distributed under this Agreement, and
13 |
14 | b) in the case of each subsequent Contributor:
15 | i) changes to the Program, and
16 | ii) additions to the Program;
17 | where such changes and/or additions to the Program originate from
18 | and are Distributed by that particular Contributor. A Contribution
19 | "originates" from a Contributor if it was added to the Program by
20 | such Contributor itself or anyone acting on such Contributor's behalf.
21 | Contributions do not include changes or additions to the Program that
22 | are not Modified Works.
23 |
24 | "Contributor" means any person or entity that Distributes the Program.
25 |
26 | "Licensed Patents" mean patent claims licensable by a Contributor which
27 | are necessarily infringed by the use or sale of its Contribution alone
28 | or when combined with the Program.
29 |
30 | "Program" means the Contributions Distributed in accordance with this
31 | Agreement.
32 |
33 | "Recipient" means anyone who receives the Program under this Agreement
34 | or any Secondary License (as applicable), including Contributors.
35 |
36 | "Derivative Works" shall mean any work, whether in Source Code or other
37 | form, that is based on (or derived from) the Program and for which the
38 | editorial revisions, annotations, elaborations, or other modifications
39 | represent, as a whole, an original work of authorship.
40 |
41 | "Modified Works" shall mean any work in Source Code or other form that
42 | results from an addition to, deletion from, or modification of the
43 | contents of the Program, including, for purposes of clarity any new file
44 | in Source Code form that contains any contents of the Program. Modified
45 | Works shall not include works that contain only declarations,
46 | interfaces, types, classes, structures, or files of the Program solely
47 | in each case in order to link to, bind by name, or subclass the Program
48 | or Modified Works thereof.
49 |
50 | "Distribute" means the acts of a) distributing or b) making available
51 | in any manner that enables the transfer of a copy.
52 |
53 | "Source Code" means the form of a Program preferred for making
54 | modifications, including but not limited to software source code,
55 | documentation source, and configuration files.
56 |
57 | "Secondary License" means either the GNU General Public License,
58 | Version 2.0, or any later versions of that license, including any
59 | exceptions or additional permissions as identified by the initial
60 | Contributor.
61 |
62 | 2. GRANT OF RIGHTS
63 |
64 | a) Subject to the terms of this Agreement, each Contributor hereby
65 | grants Recipient a non-exclusive, worldwide, royalty-free copyright
66 | license to reproduce, prepare Derivative Works of, publicly display,
67 | publicly perform, Distribute and sublicense the Contribution of such
68 | Contributor, if any, and such Derivative Works.
69 |
70 | b) Subject to the terms of this Agreement, each Contributor hereby
71 | grants Recipient a non-exclusive, worldwide, royalty-free patent
72 | license under Licensed Patents to make, use, sell, offer to sell,
73 | import and otherwise transfer the Contribution of such Contributor,
74 | if any, in Source Code or other form. This patent license shall
75 | apply to the combination of the Contribution and the Program if, at
76 | the time the Contribution is added by the Contributor, such addition
77 | of the Contribution causes such combination to be covered by the
78 | Licensed Patents. The patent license shall not apply to any other
79 | combinations which include the Contribution. No hardware per se is
80 | licensed hereunder.
81 |
82 | c) Recipient understands that although each Contributor grants the
83 | licenses to its Contributions set forth herein, no assurances are
84 | provided by any Contributor that the Program does not infringe the
85 | patent or other intellectual property rights of any other entity.
86 | Each Contributor disclaims any liability to Recipient for claims
87 | brought by any other entity based on infringement of intellectual
88 | property rights or otherwise. As a condition to exercising the
89 | rights and licenses granted hereunder, each Recipient hereby
90 | assumes sole responsibility to secure any other intellectual
91 | property rights needed, if any. For example, if a third party
92 | patent license is required to allow Recipient to Distribute the
93 | Program, it is Recipient's responsibility to acquire that license
94 | before distributing the Program.
95 |
96 | d) Each Contributor represents that to its knowledge it has
97 | sufficient copyright rights in its Contribution, if any, to grant
98 | the copyright license set forth in this Agreement.
99 |
100 | e) Notwithstanding the terms of any Secondary License, no
101 | Contributor makes additional grants to any Recipient (other than
102 | those set forth in this Agreement) as a result of such Recipient's
103 | receipt of the Program under the terms of a Secondary License
104 | (if permitted under the terms of Section 3).
105 |
106 | 3. REQUIREMENTS
107 |
108 | 3.1 If a Contributor Distributes the Program in any form, then:
109 |
110 | a) the Program must also be made available as Source Code, in
111 | accordance with section 3.2, and the Contributor must accompany
112 | the Program with a statement that the Source Code for the Program
113 | is available under this Agreement, and informs Recipients how to
114 | obtain it in a reasonable manner on or through a medium customarily
115 | used for software exchange; and
116 |
117 | b) the Contributor may Distribute the Program under a license
118 | different than this Agreement, provided that such license:
119 | i) effectively disclaims on behalf of all other Contributors all
120 | warranties and conditions, express and implied, including
121 | warranties or conditions of title and non-infringement, and
122 | implied warranties or conditions of merchantability and fitness
123 | for a particular purpose;
124 |
125 | ii) effectively excludes on behalf of all other Contributors all
126 | liability for damages, including direct, indirect, special,
127 | incidental and consequential damages, such as lost profits;
128 |
129 | iii) does not attempt to limit or alter the recipients' rights
130 | in the Source Code under section 3.2; and
131 |
132 | iv) requires any subsequent distribution of the Program by any
133 | party to be under a license that satisfies the requirements
134 | of this section 3.
135 |
136 | 3.2 When the Program is Distributed as Source Code:
137 |
138 | a) it must be made available under this Agreement, or if the
139 | Program (i) is combined with other material in a separate file or
140 | files made available under a Secondary License, and (ii) the initial
141 | Contributor attached to the Source Code the notice described in
142 | Exhibit A of this Agreement, then the Program may be made available
143 | under the terms of such Secondary Licenses, and
144 |
145 | b) a copy of this Agreement must be included with each copy of
146 | the Program.
147 |
148 | 3.3 Contributors may not remove or alter any copyright, patent,
149 | trademark, attribution notices, disclaimers of warranty, or limitations
150 | of liability ("notices") contained within the Program from any copy of
151 | the Program which they Distribute, provided that Contributors may add
152 | their own appropriate notices.
153 |
154 | 4. COMMERCIAL DISTRIBUTION
155 |
156 | Commercial distributors of software may accept certain responsibilities
157 | with respect to end users, business partners and the like. While this
158 | license is intended to facilitate the commercial use of the Program,
159 | the Contributor who includes the Program in a commercial product
160 | offering should do so in a manner which does not create potential
161 | liability for other Contributors. Therefore, if a Contributor includes
162 | the Program in a commercial product offering, such Contributor
163 | ("Commercial Contributor") hereby agrees to defend and indemnify every
164 | other Contributor ("Indemnified Contributor") against any losses,
165 | damages and costs (collectively "Losses") arising from claims, lawsuits
166 | and other legal actions brought by a third party against the Indemnified
167 | Contributor to the extent caused by the acts or omissions of such
168 | Commercial Contributor in connection with its distribution of the Program
169 | in a commercial product offering. The obligations in this section do not
170 | apply to any claims or Losses relating to any actual or alleged
171 | intellectual property infringement. In order to qualify, an Indemnified
172 | Contributor must: a) promptly notify the Commercial Contributor in
173 | writing of such claim, and b) allow the Commercial Contributor to control,
174 | and cooperate with the Commercial Contributor in, the defense and any
175 | related settlement negotiations. The Indemnified Contributor may
176 | participate in any such claim at its own expense.
177 |
178 | For example, a Contributor might include the Program in a commercial
179 | product offering, Product X. That Contributor is then a Commercial
180 | Contributor. If that Commercial Contributor then makes performance
181 | claims, or offers warranties related to Product X, those performance
182 | claims and warranties are such Commercial Contributor's responsibility
183 | alone. Under this section, the Commercial Contributor would have to
184 | defend claims against the other Contributors related to those performance
185 | claims and warranties, and if a court requires any other Contributor to
186 | pay any damages as a result, the Commercial Contributor must pay
187 | those damages.
188 |
189 | 5. NO WARRANTY
190 |
191 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
192 | PERMITTED BY APPLICABLE LAW, THE PROGRAM IS PROVIDED ON AN "AS IS"
193 | BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR
194 | IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF
195 | TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
196 | PURPOSE. Each Recipient is solely responsible for determining the
197 | appropriateness of using and distributing the Program and assumes all
198 | risks associated with its exercise of rights under this Agreement,
199 | including but not limited to the risks and costs of program errors,
200 | compliance with applicable laws, damage to or loss of data, programs
201 | or equipment, and unavailability or interruption of operations.
202 |
203 | 6. DISCLAIMER OF LIABILITY
204 |
205 | EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, AND TO THE EXTENT
206 | PERMITTED BY APPLICABLE LAW, NEITHER RECIPIENT NOR ANY CONTRIBUTORS
207 | SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
208 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST
209 | PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
210 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
211 | ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
212 | EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
213 | POSSIBILITY OF SUCH DAMAGES.
214 |
215 | 7. GENERAL
216 |
217 | If any provision of this Agreement is invalid or unenforceable under
218 | applicable law, it shall not affect the validity or enforceability of
219 | the remainder of the terms of this Agreement, and without further
220 | action by the parties hereto, such provision shall be reformed to the
221 | minimum extent necessary to make such provision valid and enforceable.
222 |
223 | If Recipient institutes patent litigation against any entity
224 | (including a cross-claim or counterclaim in a lawsuit) alleging that the
225 | Program itself (excluding combinations of the Program with other software
226 | or hardware) infringes such Recipient's patent(s), then such Recipient's
227 | rights granted under Section 2(b) shall terminate as of the date such
228 | litigation is filed.
229 |
230 | All Recipient's rights under this Agreement shall terminate if it
231 | fails to comply with any of the material terms or conditions of this
232 | Agreement and does not cure such failure in a reasonable period of
233 | time after becoming aware of such noncompliance. If all Recipient's
234 | rights under this Agreement terminate, Recipient agrees to cease use
235 | and distribution of the Program as soon as reasonably practicable.
236 | However, Recipient's obligations under this Agreement and any licenses
237 | granted by Recipient relating to the Program shall continue and survive.
238 |
239 | Everyone is permitted to copy and distribute copies of this Agreement,
240 | but in order to avoid inconsistency the Agreement is copyrighted and
241 | may only be modified in the following manner. The Agreement Steward
242 | reserves the right to publish new versions (including revisions) of
243 | this Agreement from time to time. No one other than the Agreement
244 | Steward has the right to modify this Agreement. The Eclipse Foundation
245 | is the initial Agreement Steward. The Eclipse Foundation may assign the
246 | responsibility to serve as the Agreement Steward to a suitable separate
247 | entity. Each new version of the Agreement will be given a distinguishing
248 | version number. The Program (including Contributions) may always be
249 | Distributed subject to the version of the Agreement under which it was
250 | received. In addition, after a new version of the Agreement is published,
251 | Contributor may elect to Distribute the Program (including its
252 | Contributions) under the new version.
253 |
254 | Except as expressly stated in Sections 2(a) and 2(b) above, Recipient
255 | receives no rights or licenses to the intellectual property of any
256 | Contributor under this Agreement, whether expressly, by implication,
257 | estoppel or otherwise. All rights in the Program not expressly granted
258 | under this Agreement are reserved. Nothing in this Agreement is intended
259 | to be enforceable by any entity that is not a Contributor or Recipient.
260 | No third-party beneficiary rights are created under this Agreement.
261 |
262 | Exhibit A - Form of Secondary Licenses Notice
263 |
264 | "This Source Code may also be made available under the following
265 | Secondary Licenses when the conditions for such availability set forth
266 | in the Eclipse Public License, v. 2.0 are satisfied: {name license(s),
267 | version(s), and exceptions or additional permissions here}."
268 |
269 | Simply including a copy of this Agreement, including this Exhibit A
270 | is not sufficient to license the Source Code under Secondary Licenses.
271 |
272 | If it is not possible or desirable to put the notice in a particular
273 | file, then You may include the notice in a location (such as a LICENSE
274 | file in a relevant directory) where a recipient would be likely to
275 | look for such a notice.
276 |
277 | You may add additional accurate notices of copyright ownership.
278 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # J.A.R.V.I.S AI and Assistant
2 |
3 |
4 | ## About
5 | J.A.R.V.I.S is a personal assistant for Windows and Linux users (Mac coming soon!). J.A.R.V.I.S is free and open source, and is available on GitHub. Originaly developed by [SaptakBhoumik](https://github.com/SaptakBhoumik), J.A.R.V.I.S is now maintained by [J-dogcoder](https://github.com/j-dogcoder/)
6 |
7 |
8 | ## Requirements
9 |
10 | - Python 3.6 or Above.
11 | - Internet Connection
12 | - Microphone
13 | - Speakers
14 | - At least 10GB of free storage
15 | - At least 8GB Ram
16 |
17 | ## Getting Started
18 | In order to start J.A.R.V.I.S just clone this repository or download the source code
19 | Then open command prompt in the directory where you have stored the source code and run the following command
20 | ```shell
21 | pip3 install -r requirements.txt
22 | python3 app.py
23 | ```
24 | Wait for sometime for the program to start running(Note: On running it for the first time it will downoad some models which will take some time)
25 | Then click on the arc reactor(rotating ring) or press f5 and start saying what you want to say
26 |
27 | ## Features
28 | Currently J.A.R.V.I.S can do the following things:
29 |
30 | - Tell you jokes to make you feel better🙂(For example you can say "Tell me a joke")
31 | - Tell you the time⏲(For example you can say "Tell me the time")
32 | - Tell your location📍(For example you can say "Where am i")
33 | - Tell the weather of your city or some other city🌫️(For example you can say "How is the weather" or "How is the weather in Delhi")
34 | - Tell you the latest news📰(For example you can say "What happened today")
35 | - Answer your question⁉️(For example you can say "Who is Elon Musk" or "What is plasma")
36 | - Control your screen brightness🔆(For example you can say "Reduce the brightness" or "Increase the brightness" or "Set screen brightness to 70")
37 | - Create strong password for you🔑(For example you can say "Create a password")
38 | - He can also write about any topic✍️(For example you can say "Write something climate change")
39 | - Tell you the meaning of any word📙(For example you can say "What is the meaning of titanium")
40 | - Open url🕸️(For example you can say "Open google")
41 | - Play youtube videos▶️(For example you can say "Play never gonna give you up")
42 | - And if you feel alone just chat with him just like you would do with a human💬(For example you can say "How are you")
43 |
44 | More features are comming soon so make sure to star and watch this repo so that you never miss any update
45 |
46 |
47 | ## How to contribute
48 | Since it is a free software, you can contribute to make it better. New contributors are always welcome, whether you write code, create resources, report bugs, or suggest features.
49 |
50 | The J.A.R.V.I.S is written primarily in Python3x
51 |
52 | Have a look at the [open issues](https://github.com/j-dogcoder/AI/issues) to find a mission that resonates with you.
53 |
54 | Please check [CONTRIBUTING.md](https://github.com/j-dogcoder/AI/blob/master/CONTRIBUTING.md) to know how you can contribute
55 |
56 | ## License
57 | J.A.R.V.I.S is lisenced under Eclipse Public License - v 2.0
58 |
59 |
--------------------------------------------------------------------------------
/app.py:
--------------------------------------------------------------------------------
1 | from PyQt5 import QtCore, QtGui, QtWidgets, QtWebEngineWidgets
2 | import concurrent.futures
3 | import threading
4 | import os
5 | from easySpeech import speech
6 | from backend.core import core
7 | from backend.speak import speak
8 |
9 |
10 | class MainThread(QtCore.QThread):
11 | def __init__(self):
12 | super(MainThread,self).__init__()
13 |
14 | @QtCore.pyqtSlot()
15 | def run(self):
16 | with concurrent.futures.ThreadPoolExecutor() as executor:
17 | try:
18 | future = executor.submit(speech.speech,"google")
19 | return_value = future.result()
20 | except:
21 | return_value=""
22 | print(return_value)
23 | with concurrent.futures.ThreadPoolExecutor() as main:
24 | try:
25 | main_core = main.submit(core,return_value)
26 | value = main_core.result()
27 | speak(value)
28 | except:
29 | pass
30 |
31 |
32 | class Widget(QtWidgets.QWidget):
33 | def __init__(self, parent=None):
34 | super(Widget, self).__init__(parent)
35 | # defining shotcuts
36 | self.shortcut_open = QtWidgets.QShortcut(QtGui.QKeySequence('f5'), self)
37 | self.shortcut_open.activated.connect(self.download)
38 | self.setWindowTitle("J.A.R.V.I.S")
39 | self.setFixedSize(330, 620)
40 | self.setWindowFlag(QtCore.Qt.FramelessWindowHint)
41 | self.setStyleSheet('background-color: black;color:white')
42 | self.view = QtWebEngineWidgets.QWebEngineView()
43 | self.view .setContextMenuPolicy(QtCore.Qt.NoContextMenu)
44 | self.view.page().profile().downloadRequested.connect(self.on_downloadRequested)
45 | self.view.load(QtCore.QUrl("https://j-dogcoder.github.io/AI/templates/"))
46 | hbox = QtWidgets.QHBoxLayout(self)
47 | hbox.addWidget(self.view)
48 | self.setWindowIcon(QtGui.QIcon(os.path.join('images', 'source.png')))
49 |
50 | def download(self):
51 | try:
52 | function=MainThread()
53 | th = threading.Thread(target=function.run)
54 | th.daemon = True
55 | th.start()
56 | except:
57 | pass
58 |
59 | #yes you are right i am using download requested to call python function
60 | @QtCore.pyqtSlot("QWebEngineDownloadItem*")
61 | def on_downloadRequested(self):
62 | try:
63 | function=MainThread()
64 | th = threading.Thread(target=function.run)
65 | th.daemon = True
66 | th.start()
67 | except:
68 | pass
69 |
70 | if __name__ == "__main__":
71 | import sys
72 | app = QtWidgets.QApplication(sys.argv)
73 | w = Widget()
74 | w.show()
75 | sys.exit(app.exec_())
76 |
--------------------------------------------------------------------------------
/backend/__init__.py:
--------------------------------------------------------------------------------
1 | from __future__ import absolute_import
2 |
3 | __project__ = 'J.A.R.V.I.S'
4 | __version__ = '0.0.2'
5 | __keywords__ = ['jarvis', 'J.A.R.V.I.S', 'ai', 'virtual assistant']
6 | __author__ = 'Adapt Development'
7 | __author_email__ = 'saptakbhoumik@gmail.com'
8 | __platforms__ = 'WINDOWS|LINUX'
--------------------------------------------------------------------------------
/backend/__pycache__/location.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/backend/__pycache__/location.cpython-38.pyc
--------------------------------------------------------------------------------
/backend/__pycache__/music.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/backend/__pycache__/music.cpython-38.pyc
--------------------------------------------------------------------------------
/backend/__pycache__/search.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/backend/__pycache__/search.cpython-38.pyc
--------------------------------------------------------------------------------
/backend/__pycache__/speak.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/backend/__pycache__/speak.cpython-38.pyc
--------------------------------------------------------------------------------
/backend/__pycache__/weather.cpython-38.pyc:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/backend/__pycache__/weather.cpython-38.pyc
--------------------------------------------------------------------------------
/backend/chat.py:
--------------------------------------------------------------------------------
1 | from transformers import BlenderbotTokenizer, BlenderbotForConditionalGeneration
2 | try:
3 | mname = 'facebook/blenderbot-400M-distill'
4 | model = BlenderbotForConditionalGeneration.from_pretrained(mname)
5 | tokenizer = BlenderbotTokenizer.from_pretrained(mname)
6 | except:
7 | print("No internet")
8 | pass
9 | def chat(query):
10 | inputs = tokenizer([query], return_tensors='pt')
11 | reply_ids = model.generate(**inputs)
12 | return tokenizer.batch_decode(reply_ids,skip_special_tokens=True)[0]
13 |
14 |
--------------------------------------------------------------------------------
/backend/core.py:
--------------------------------------------------------------------------------
1 | #The core.py file contains all commands for jarvis but some commands are also present in app.py
2 | from .search import *
3 | from .location import *
4 | from .weather import *
5 | from .news import *
6 | from .password import *
7 | from .chat import *
8 | from pysimilar import compare
9 | from word2number import w2n
10 | from PyDictionary import PyDictionary
11 | import screen_brightness_control as sbc
12 | import wikipedia
13 | import webbrowser
14 | import pyjokes
15 | import datetime
16 | from youtubesearchpython import VideosSearch
17 |
18 |
19 | #commands for introduction
20 | commandA='who are you'
21 | commandB='what is your name'
22 | commandC='who is jarvis'
23 | commandD='jarvis who is jarvis'
24 | commandE='introduce yourself'
25 | #commands for telling jokes
26 | commandF='tell me a joke'
27 | commandG='make me laugh'
28 | #commands for telling time
29 | commandH='what is the time'
30 | commandI='tell me the time'
31 | #commands for telling location
32 | commandJ='where am i'
33 | commandK='tell me my location'
34 | #commands for telling weather of the current city
35 | commandL='how is the weather'
36 | commandM='tell me about the weather'
37 | #commands for telling weather of the required city
38 | commandL2='how is the weather in'
39 | commandM2='tell me about the weather of'
40 | #commands for greeting
41 | commandN='how are you'
42 | #commands for news
43 | commandO='what happened today'
44 | commandP='tell me about the news'
45 | #commands for asking question
46 | commandQ='who is'
47 | commandR='what is'
48 | #commands for reducing brightness
49 | commandS='reduce the brightness'
50 | commandT='reduce the screen brightness'
51 | commandU='reduce screen brightness'
52 | commandV='reduce brightness'
53 | #commands for increasing brightness
54 | commandW='increase the brightness'
55 | commandX='increase the screen brightness'
56 | commandY='increase screen brightness'
57 | commandZ='increase brightness'
58 | #commands for setting brightness
59 | commandAA='set screen brightness to'
60 | #commands for setting password
61 | commandAB='create a password'
62 | commandAC='generate a password'
63 | commandAD='jarvis create a password'
64 | commandAE='jarvis generate a password'
65 | #commands for generaing text
66 | commandAF="jarvis write something about"
67 | commandAG="write something about"
68 | #commands for telling meaning
69 | commandAH="what is the meaning of"
70 | commandAI="meaning of"
71 | #bit of chat
72 | chatA="are you there"
73 | chatB="are you up"
74 |
75 |
76 | def core(query):
77 | q=query.lower()
78 | q=query.replace(".","")
79 |
80 | #for 0 input
81 | if q.replace(" ","")=="":
82 | text="Sorry about that I didn't hear anything"
83 |
84 |
85 | #for introduction
86 | elif compare(commandA,q)>0.65 or compare(commandB,q)>0.65 or compare(commandC,q)>0.65 or compare(commandD,q)>0.65 or compare(commandE,q)>0.65 or commandA.replace(" ","") in q.replace(" ","") or commandB.replace(" ","") in q.replace(" ","") or commandC.replace(" ","") in q.replace(" ","") or commandD.replace(" ","") in q.replace(" ","") or commandE.replace(" ","") in q.replace(" ",""):
87 | if q.replace(" ","")=="whois" or q.replace(" ","")=="whatis" or q.replace(" ","")=="jarviswhois" or q.replace(" ","")=="jarviswhatis":
88 | text="Please tell me what do you want to know about"
89 | else:
90 | text="Allow me to introduce myself I am Jarvis, the virtual artificial intelligence and I'm here to assist you with a variety of tasks as best I can, 24 hours a day seven days a week"
91 |
92 |
93 | #for greeting
94 | elif compare(commandN,q)>0.65 or commandN.replace(" ","") in q.replace(" ",""):
95 | text="I am fine, how may I help you"
96 |
97 | #for telling meaning
98 | elif commandAH.replace(" ","") in q.replace(" ","") or commandAI.replace(" ","") in q.replace(" ",""):
99 | q=q.replace(commandAH,"")
100 | q=q.replace(commandAI,"")
101 | q=q.replace('jarvis',"")
102 | if q.replace(" ","")=="":
103 | text="Sorry about that but I could not hear which word's meaning you want to know"
104 | else:
105 | dictionary=PyDictionary()
106 | dic=dictionary.meaning(q)
107 | try:
108 | text=dic['Noun'][0]
109 | text=f"The meaning of the word {q} is {text}"
110 | except:
111 | try:
112 | text=dic['Verb'][0]
113 | text=f"The meaning of the word {q} is {text}"
114 | except:
115 | try:
116 | text=dic['Adjective'][0]
117 | text=f"The meaning of the word {q} is {text}"
118 | except:
119 | text=f"Sorry about that but I don't know the meaning of {q}"
120 |
121 |
122 | #bit of chat
123 | elif compare(chatA,q)>0.65 or compare(chatB,q)>0.65 or chatA.replace(" ","") in q.replace(" ","") or chatB.replace(" ","") in q.replace(" ",""):
124 | text="For you always"
125 |
126 | #for telling time
127 | elif compare(commandH,q)>0.65 or compare(commandI,q)>0.65 or commandH.replace(" ","") in q.replace(" ","") or commandI.replace(" ","") in q.replace(" ",""):
128 | time=datetime.datetime.now().strftime('%I:%M %p')
129 | text=f'Now it is {time}'
130 |
131 |
132 | #for asking question
133 | elif commandQ.replace(" ","") in q.replace(" ","") or commandR.replace(" ","") in q.replace(" ",""):
134 | q=q.replace(" ","")
135 | q=q.replace("jarvis","")
136 | q=q.replace("whois","")
137 | q=q.replace("whatis","")
138 | if q=="":
139 | text="Please tell me what do you want to know about"
140 | else:
141 | try:
142 | text=f"According to wikipedia {wikipedia.summary(q, sentences = 5)}"
143 | except:
144 | try:
145 | text="Here is what i found on the internet"
146 | results=search(query.replace("jarvis",""))
147 | webbrowser.open(results)
148 | except:
149 | text="Sorry about that but I can't find the answer to your question"
150 |
151 | #for generaing text
152 | elif commandAF.replace(" ","") in q.replace(" ","") or commandAG.replace(" ","")in q.replace(" ",""):
153 | quaryA=q.replace(commandAF,"")
154 | quaryB=quaryA.replace(commandAG,"")
155 | if quaryB.replace(" ","")=="":
156 | text="Sorry about that but i couldn't hear about what i should write"
157 | else:
158 | try:
159 | from .story import story
160 | written=story(quaryB,char=1000)
161 | if written==quaryB:
162 | text=f"Sorry about that but i don't anything about this"
163 | else:
164 | text=f"Here is what i have written, {written}"
165 | except:
166 | text=f"Sorry about that but i don't anything about this"
167 |
168 | #for creating passwords
169 | elif compare(commandAB,q)>0.65 or compare(commandAC,q)>0.65 or compare(commandAD,q)>0.65 or compare(commandAE,q)>0.65 or commandAB.replace(" ","") in q.replace(" ","") or commandAC.replace(" ","") in q.replace(" ","") or commandAD.replace(" ","") in q.replace(" ","") or commandAE.replace(" ","") in q.replace(" ",""):
170 | result=password()
171 | text=f"You can use {result} as your password"
172 |
173 |
174 | #for telling joke
175 | elif compare(commandF,q)>0.65 or commandF.replace(" ","") in q.replace(" ","") or compare(commandG,q)>0.65 or commandG.replace(" ","") in q.replace(" ","") :
176 | text=pyjokes.get_joke(language='en', category= 'all')
177 |
178 |
179 | #for reducing brightness
180 | elif compare(commandS,q)>0.65 or compare(commandT,q)>0.65 or compare(commandU,q)>0.65 or compare(commandV,q)>0.65 or commandS.replace(" ","") in q.replace(" ","") or commandT.replace(" ","") in q.replace(" ","") or commandU.replace(" ","") in q.replace(" ","") or commandV.replace(" ","") in q.replace(" ",""):
181 | try:
182 | current_brightness = sbc.get_brightness()
183 | if current_brightness==0:
184 | text="Your screen brightness is already at it's lowest level"
185 | else:
186 | text="Okay"
187 | sbc.set_brightness(current_brightness-10)
188 | except:
189 | text="Looks like I don't have the permission to reduce your screen brightness"
190 |
191 | #for increasing brightness
192 | elif compare(commandW,q)>0.65 or compare(commandX,q)>0.65 or compare(commandY,q)>0.65 or compare(commandZ,q)>0.65 or commandW.replace(" ","") in q.replace(" ","") or commandX.replace(" ","") in q.replace(" ","") or commandY.replace(" ","") in q.replace(" ","") or commandZ.replace(" ","") in q.replace(" ",""):
193 | try:
194 | current_brightness = sbc.get_brightness()
195 | if current_brightness==100:
196 | text="Your screen brightness is already at it's highest level"
197 | else:
198 | text="Okay"
199 | sbc.set_brightness(current_brightness+10)
200 | except:
201 | text="Looks like I don't have the permission to increase your screen brightness"
202 |
203 |
204 | #for setting brightness
205 | elif commandAA.replace(" ","") in q.replace(" ",""):
206 | q=q.replace("set",'')
207 | q=q.replace("screen",'')
208 | q=q.replace("brightness",'')
209 | q=q.replace("to",'')
210 | q=q.replace("jarvis",'')
211 | if q.replace(" ","")=="":
212 | text="Sorry about that but I couldn't understand what should be the screen brightness"
213 | else:
214 | try:
215 | try:
216 | q=int(q.replace(" ",''))
217 | if q<0:
218 | text="Sorry about that but screen brightness can't be less than 0"
219 | elif q>100:
220 | text="Sorry about that but screen brightness can't be more than 100"
221 | else:
222 | text="Okay"
223 | sbc.set_brightness(q)
224 | except ValueError:
225 | try:
226 | q=int(w2n.word_to_num(q))
227 | if q<0:
228 | text="Sorry about that but screen brightness can't be less than 0"
229 | elif q>100:
230 | text="Sorry about that but screen brightness can't be more than 100"
231 | else:
232 | text="Okay"
233 | sbc.set_brightness(q)
234 | except:
235 | text="Sorry about that but I couldn't understand what should be the screen brightness"
236 |
237 | except:
238 | text="Looks like I don't have the permission to increase your screen brightness"
239 |
240 | #for telling news
241 | elif commandO.replace(" ","") in q.replace(" ","") or commandP.replace(" ","") in q.replace(" ","") or q.replace(" ","") == "news":
242 | try:
243 |
244 | text=news()
245 |
246 | except:
247 | text="Sorry about that but I couldn't access the server"
248 |
249 |
250 | #for telling location
251 | elif compare(commandJ,q)>0.65 or compare(commandK,q)>0.65 or commandJ.replace(" ","") in q.replace(" ","") or commandK.replace(" ","") in q.replace(" ",""):
252 | try:
253 | locate=location()
254 | locate=str(locate)
255 | text=f'You are currently in {locate}'
256 | except:
257 | text="Sorry about that but I couldn't access the server"
258 |
259 | #for telling weather of the required city
260 | elif commandL2.replace(" ","") in q.replace(" ","") or commandM2.replace(" ","") in q.replace(" ",""):
261 | try:
262 | city=q.replace("jarvis","").replace(" ","")
263 | city=city.replace(commandL2.replace(" ",""),"")
264 | city=city.replace(commandM2.replace(" ",""),"")
265 | if city.replace(" ","")=="":
266 | text="Which city's weather you want to know"
267 | else:
268 | text=weather(city)
269 | except:
270 | text="Sorry about that but I couldn't access the server"
271 |
272 | #for telling weather of the current city
273 | elif compare(commandL,q)>0.65 or compare(commandM,q)>0.65 or commandL.replace(" ","") in q.replace(" ","") or commandM.replace(" ","") in q.replace(" ",""):
274 | try:
275 | locate=location()
276 | locate=str(locate)
277 | locate=locate.split(",")
278 | city=locate[2]
279 | text=f'In {city} {weather(city)}'
280 |
281 | except:
282 | text="Sorry about that but I couldn't access the server"
283 |
284 | #for playing video
285 | elif q.find("play")==0 or q.replace(" ","").find("jarvisplay")==0:
286 | q=q.replace("jarvis","")
287 | try:
288 | text="Here is what i found on the internet"
289 | if q.replace(" ","")=='play':
290 | webbrowser.open('https://www.google.com/search?q=play')
291 | elif q.replace(" ","")=='playmeaning':
292 | webbrowser.open('https://www.google.com/search?q=play+meaning')
293 | else:
294 | q=q.replace("play","")
295 | videosSearch = VideosSearch(q, limit = 1)
296 | a=videosSearch.result()
297 | a=a['result']
298 | a=str(a[0]['link'])
299 | webbrowser.open(a)
300 | except:
301 | text="Sorry about that but I couldn't understand which video to play"
302 |
303 |
304 | #for opening url
305 | elif q.find("open")==0 or q.replace(" ","").find("jarvisopen")==0:
306 | try:
307 | text="Here is what i found on the internet"
308 | if q.replace(' ','')=='open' or q.replace(' ','')=='jarvisopen':
309 | webbrowser.open('https://www.google.com/search?q=open')
310 | if q.replace(' ','')=='openmeaning' or q.replace(' ','')=='jarvisopenmeaning':
311 | webbrowser.open('https://www.google.com/search?q=open+meaning')
312 | else:
313 | q=q.replace("open","")
314 | q=q.replace("jarvis","")
315 | results=search(q)
316 | webbrowser.open(results)
317 | except:
318 | text="Sorry about that but I couldn't understand what to open"
319 |
320 | #chatting or searching the web if can't answer question
321 | else:
322 | if q.replace(" ","")=='jarvis':
323 | text="Hello, I am jarvis how may I help you"
324 | else:
325 | try:
326 | text=chat(query)
327 | if text=="":
328 | text="Here is what i found on the internet"
329 | webbrowser.open(f'https://www.google.com/search?q={query}')
330 | else:
331 | text=text
332 | except:
333 | text="Here is what i found on the internet"
334 | webbrowser.open(f'https://www.google.com/search?q={query}')
335 |
336 | print(text)
337 | return text
338 |
339 |
340 |
--------------------------------------------------------------------------------
/backend/location.py:
--------------------------------------------------------------------------------
1 | import geocoder
2 | from geopy.geocoders import Nominatim
3 |
4 | def location():
5 | geolocator = Nominatim(user_agent="geoapiExercises")
6 | g = geocoder.ip('me')
7 | coordinates=g.latlng
8 | latitude=str(coordinates[0])
9 | longitude=str(coordinates[1])
10 | location = geolocator.geocode(latitude+","+longitude)
11 | return location
--------------------------------------------------------------------------------
/backend/news.py:
--------------------------------------------------------------------------------
1 | import bs4
2 | from urllib.request import urlopen
3 |
4 | def news():
5 | url = "https://news.google.com/news/rss"
6 | client = urlopen(url)
7 | xml_page = client.read()
8 | client.close()
9 | page = bs4.BeautifulSoup(xml_page, 'xml')
10 | news_list = page.findAll("item")
11 | headlines=""
12 | for news in news_list:
13 | headlines+=news.title.text
14 | return headlines
--------------------------------------------------------------------------------
/backend/password.py:
--------------------------------------------------------------------------------
1 | import random
2 | import string
3 | def password():
4 | lower = string.ascii_lowercase
5 | upper = string.ascii_uppercase
6 | num = string.digits
7 | all = lower + upper + num
8 | temp = random.sample(all,10)
9 | password = "".join(temp)
10 | return password
--------------------------------------------------------------------------------
/backend/record.py:
--------------------------------------------------------------------------------
1 | #under development
2 | from __future__ import division as _division
3 |
4 | import wave as _wave
5 | import numpy as _np
6 |
7 | def _array2wav(a, sampwidth):
8 |
9 | if sampwidth == 3:
10 | # `a` must have dtype int32
11 | if a.ndim == 1:
12 | # Convert to a 2D array with a single column.
13 | a = a.reshape(-1, 1)
14 | # By shifting first 0 bits, then 8, then 16, the resulting output
15 | # is 24 bit little-endian.
16 | a8 = (a.reshape(a.shape + (1,)) >> _np.array([0, 8, 16])) & 255
17 | wavdata = a8.astype(_np.uint8).tostring()
18 | else:
19 | # Make sure the array is little-endian, and then convert using
20 | # tostring()
21 | a = a.astype('<' + a.dtype.str[1:], copy=False)
22 | wavdata = a.tostring()
23 | return wavdata
24 |
25 |
26 | class Wav(object):
27 |
28 | def __init__(self, data, rate, sampwidth):
29 | self.data = data
30 | self.rate = rate
31 | self.sampwidth = sampwidth
32 |
33 | def __repr__(self):
34 | s = ("Wav(data.shape=%s, data.dtype=%s, rate=%r, sampwidth=%r)" %
35 | (self.data.shape, self.data.dtype, self.rate, self.sampwidth))
36 | return s
37 |
38 |
39 |
40 |
41 |
42 | _sampwidth_dtypes = {1: _np.uint8,
43 | 2: _np.int16,
44 | 3: _np.int32,
45 | 4: _np.int32}
46 | _sampwidth_ranges = {1: (0, 256),
47 | 2: (-2**15, 2**15),
48 | 3: (-2**23, 2**23),
49 | 4: (-2**31, 2**31)}
50 |
51 |
52 | def _scale_to_sampwidth(data, sampwidth, vmin, vmax):
53 | # Scale and translate the values to fit the range of the data type
54 | # associated with the given sampwidth.
55 |
56 | data = data.clip(vmin, vmax)
57 |
58 | dt = _sampwidth_dtypes[sampwidth]
59 | if vmax == vmin:
60 | data = _np.zeros(data.shape, dtype=dt)
61 | else:
62 | outmin, outmax = _sampwidth_ranges[sampwidth]
63 | if outmin != vmin or outmax != vmax:
64 | vmin = float(vmin)
65 | vmax = float(vmax)
66 | data = (float(outmax - outmin) * (data - vmin) /
67 | (vmax - vmin)).astype(_np.int64) + outmin
68 | data[data == outmax] = outmax - 1
69 | data = data.astype(dt)
70 |
71 | return data
72 |
73 |
74 | def write(file, data, rate, scale=None, sampwidth=None):
75 |
76 | if sampwidth is None:
77 | if not _np.issubdtype(data.dtype, _np.integer) or data.itemsize > 4:
78 | raise ValueError('when data.dtype is not an 8-, 16-, or 32-bit '
79 | 'integer type, sampwidth must be specified.')
80 | sampwidth = data.itemsize
81 | else:
82 | if sampwidth not in [1, 2, 3, 4]:
83 | raise ValueError('sampwidth must be 1, 2, 3 or 4.')
84 |
85 | outdtype = _sampwidth_dtypes[sampwidth]
86 | outmin, outmax = _sampwidth_ranges[sampwidth]
87 |
88 | if scale == "none":
89 | data = data.clip(outmin, outmax-1).astype(outdtype)
90 | elif scale == "dtype-limits":
91 | if not _np.issubdtype(data.dtype, _np.integer):
92 | raise ValueError("scale cannot be 'dtype-limits' with "
93 | "non-integer data.")
94 | # Easy transforms that just changed the signedness of the data.
95 | if sampwidth == 1 and data.dtype == _np.int8:
96 | data = (data.astype(_np.int16) + 128).astype(_np.uint8)
97 | elif sampwidth == 2 and data.dtype == _np.uint16:
98 | data = (data.astype(_np.int32) - 32768).astype(_np.int16)
99 | elif sampwidth == 4 and data.dtype == _np.uint32:
100 | data = (data.astype(_np.int64) - 2**31).astype(_np.int32)
101 | elif data.itemsize != sampwidth:
102 | # Integer input, but rescaling is needed to adjust the
103 | # input range to the output sample width.
104 | ii = _np.iinfo(data.dtype)
105 | vmin = ii.min
106 | vmax = ii.max
107 | data = _scale_to_sampwidth(data, sampwidth, vmin, vmax)
108 | else:
109 | if scale is None:
110 | vmin = data.min()
111 | vmax = data.max()
112 | else:
113 | # scale must be a tuple of the form (vmin, vmax)
114 | vmin, vmax = scale
115 | if vmin is None:
116 | vmin = data.min()
117 | if vmax is None:
118 | vmax = data.max()
119 |
120 | data = _scale_to_sampwidth(data, sampwidth, vmin, vmax)
121 |
122 |
123 |
124 | if data.ndim == 1:
125 | data = data.reshape(-1, 1)
126 |
127 | wavdata = _array2wav(data, sampwidth)
128 |
129 | w = _wave.open(file, 'wb')
130 | w.setnchannels(data.shape[1])
131 | w.setsampwidth(sampwidth)
132 | w.setframerate(rate)
133 | w.writeframes(wavdata)
134 | w.close()
--------------------------------------------------------------------------------
/backend/search.py:
--------------------------------------------------------------------------------
1 | from bs4 import BeautifulSoup
2 | import requests
3 |
4 | def search(query):
5 | USER_AGENT='Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36/10csO9CgK-99'
6 | query=query
7 | URL= f'https://www.google.com/search?q={query}&num=1'
8 | headers={"user-agent":USER_AGENT}
9 | requests_session = requests.Session()
10 | resp=requests_session.get(URL,headers=headers)
11 | if resp.status_code==200:
12 | soup=BeautifulSoup(resp.text,"lxml")
13 | results=[]
14 | for g in soup.find_all('div',class_="yuRUbf"):
15 | anchors=g.find_all('a')
16 | if anchors:
17 | link=anchors[0]['href']
18 | results=link
19 | return results
20 |
--------------------------------------------------------------------------------
/backend/speak.py:
--------------------------------------------------------------------------------
1 | import pyttsx3
2 |
3 | engine = pyttsx3.init()
4 | voices = engine.getProperty('voices')
5 | engine.setProperty('voice', voices[0].id)
6 |
7 |
8 | def speak(text):
9 | engine.say(text)
10 | engine.runAndWait()
11 |
--------------------------------------------------------------------------------
/backend/speech.py:
--------------------------------------------------------------------------------
1 | #under development
2 | import librosa
3 | import torch
4 | from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
5 | from .record import *
6 | import sounddevice as sd
7 | #load pre-trained model and tokenizer
8 | tokenizer = Wav2Vec2Processor.from_pretrained("facebook/wav2vec2-base-960h")
9 | model = Wav2Vec2ForCTC.from_pretrained("facebook/wav2vec2-base-960h")
10 |
11 | def speech(audio="recording.wav",freq = 44100,duration = 5):
12 | recording = sd.rec(int(duration * freq),
13 | samplerate=freq, channels=2)
14 |
15 | # Record audio for the given number of seconds
16 | sd.wait()
17 | write(audio, recording, freq, sampwidth=2)
18 | #load any audio file of your choice
19 | speech, rate = librosa.load(audio,sr=16000)
20 | input_values = tokenizer(speech, return_tensors = 'pt').input_values
21 | #Store logits (non-normalized predictions)
22 | logits = model(input_values).logits
23 | #Store predicted id's
24 | predicted_ids = torch.argmax(logits, dim =-1)
25 | #decode the audio to generate text
26 | transcriptions = tokenizer.decode(predicted_ids[0])
27 | return transcriptions
--------------------------------------------------------------------------------
/backend/story.py:
--------------------------------------------------------------------------------
1 | import tensorflow as tf
2 | from transformers import GPT2LMHeadModel, GPT2Tokenizer
3 | try:
4 | tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
5 | model = GPT2LMHeadModel.from_pretrained("gpt2", pad_token_id=tokenizer.eos_token_id)
6 | except:
7 | print("No internet")
8 | pass
9 |
10 | def story(sentence,char=100):
11 | input_ids = tokenizer.encode(sentence, return_tensors='pt')
12 | output = model.generate(input_ids, max_length=char, num_beams=5, no_repeat_ngram_size=2, early_stopping=True)
13 | text = tokenizer.decode(output[0], skip_special_tokens=True)
14 | return text
15 |
16 |
--------------------------------------------------------------------------------
/backend/weather.py:
--------------------------------------------------------------------------------
1 | from bs4 import BeautifulSoup
2 | import requests
3 |
4 | def weather(city):
5 | url = f"https://www.google.com/search?q=weather{city}"
6 | html = requests.get(url).content
7 | soup = BeautifulSoup(html,"lxml")
8 | temp = soup.find('div', attrs={'class': 'BNeawe iBp4i AP7Wnd'}).text
9 | str = soup.find('div', attrs={'class': 'BNeawe tAd8D AP7Wnd'}).text
10 | data = str.split('\n')
11 | time = data[0]
12 | sky = data[1]
13 | listdiv = soup.findAll('div', attrs={'class': 'BNeawe s3v9rd AP7Wnd'})
14 | strd = listdiv[5].text
15 | pos = strd.find('Wind')
16 | other_data = strd[pos:]
17 | result = f'The temperature is currently {temp.replace("C", "celcius")} and the sky is now {sky}'
18 | return result
19 |
20 |
--------------------------------------------------------------------------------
/images/Source.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/images/Source.ico
--------------------------------------------------------------------------------
/images/Source.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/images/Source.png
--------------------------------------------------------------------------------
/images/ss.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jaspermayone-archive/AI/3c043d347b72f16a68d87b42e8f9a4148586de47/images/ss.png
--------------------------------------------------------------------------------
/renovate.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": [
3 | "config:base"
4 | ]
5 | }
6 |
--------------------------------------------------------------------------------
/requirements.txt:
--------------------------------------------------------------------------------
1 | beautifulsoup4
2 | DateTime
3 | pysimilar
4 | PyDictionary
5 | easySpeech
6 | geocoder
7 | geopy
8 | huggingface-hub
9 | librosa
10 | nltk
11 | numpy
12 | playsound
13 | pyjokes
14 | PyQt5
15 | PyQtWebEngine
16 | pyttsx3
17 | requests
18 | scikit-learn
19 | screen-brightness-control
20 | screeninfo
21 | sip
22 | sounddevice
23 | tensorflow
24 | tokenizers
25 | torch
26 | torchaudio
27 | transformers
28 | urllib3
29 | wikipedia
30 | word2number
31 | youtube-search-python
32 |
--------------------------------------------------------------------------------
/templates/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |