yf-vai 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- yf_vai-1.0.0/PKG-INFO +28 -0
- yf_vai-1.0.0/setup.cfg +4 -0
- yf_vai-1.0.0/setup.py +26 -0
- yf_vai-1.0.0/yf_vai/__init__.py +1 -0
- yf_vai-1.0.0/yf_vai/main.py +43 -0
- yf_vai-1.0.0/yf_vai.egg-info/PKG-INFO +28 -0
- yf_vai-1.0.0/yf_vai.egg-info/SOURCES.txt +8 -0
- yf_vai-1.0.0/yf_vai.egg-info/dependency_links.txt +1 -0
- yf_vai-1.0.0/yf_vai.egg-info/requires.txt +3 -0
- yf_vai-1.0.0/yf_vai.egg-info/top_level.txt +1 -0
yf_vai-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yf_vai
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: This package can be used to make an AI voice Assistant in just 2 lines of code.
|
|
5
|
+
Home-page: https://www.youtube.com/@YamaanFarazYFTMofficial
|
|
6
|
+
Author: Yamaan Faraz YF® official
|
|
7
|
+
Author-email: farazyamaan@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: voice ai,YF,streamlit voice ai,Yamaan Faraz YF® official package
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Requires-Dist: groq
|
|
19
|
+
Requires-Dist: gtts
|
|
20
|
+
Requires-Dist: streamlit
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: keywords
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
yf_vai-1.0.0/setup.cfg
ADDED
yf_vai-1.0.0/setup.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from setuptools import setup
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name='yf_vai', #* Your package will have this name
|
|
5
|
+
packages=['yf_vai'], #* Name the package again
|
|
6
|
+
version='1.0.0', #* To be increased every time your change your library
|
|
7
|
+
license='MIT', # Type of license. More here: https://help.github.com/articles/licensing-a-repository
|
|
8
|
+
description='This package can be used to make an AI voice Assistant in just 2 lines of code.',
|
|
9
|
+
# Short description of your library
|
|
10
|
+
author='Yamaan Faraz YF® official', # Your name
|
|
11
|
+
author_email='farazyamaan@gmail.com', # Your email
|
|
12
|
+
url='https://www.youtube.com/@YamaanFarazYFTMofficial', # Homepage of your library (e.g. github or your website)
|
|
13
|
+
keywords=['voice ai', 'YF', 'streamlit voice ai', "Yamaan Faraz YF® official package"], # Keywords users can search on pypi.org
|
|
14
|
+
install_requires=['groq','gtts' ,'streamlit'], # Other 3rd-party libs that pip needs to install
|
|
15
|
+
classifiers=[
|
|
16
|
+
'Development Status :: 3 - Alpha',
|
|
17
|
+
# Chose either "3 - Alpha", "4 - Beta" or "5 - Production/Stable" as the current state of your package
|
|
18
|
+
'Intended Audience :: Developers', # Who is the audience for your library?
|
|
19
|
+
'Topic :: Software Development :: Build Tools',
|
|
20
|
+
'License :: OSI Approved :: MIT License', # Type a license again
|
|
21
|
+
'Programming Language :: Python :: 3.8', # Python versions that your library supports
|
|
22
|
+
'Programming Language :: Python :: 3.9',
|
|
23
|
+
'Programming Language :: Python :: 3.10',
|
|
24
|
+
'Programming Language :: Python :: 3.11',
|
|
25
|
+
],
|
|
26
|
+
)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .main import *
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
import streamlit as st
|
|
4
|
+
from groq import Groq
|
|
5
|
+
from gtts import gTTS
|
|
6
|
+
import io
|
|
7
|
+
def create_vai(api_key, title):
|
|
8
|
+
client = Groq(api_key=api_key)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
st.title(title)
|
|
13
|
+
|
|
14
|
+
i1 = st.audio_input("Speak anything")
|
|
15
|
+
|
|
16
|
+
if i1:
|
|
17
|
+
# 1. Transcribe Audio (Speech-to-Text) using Whisper on Groq
|
|
18
|
+
audio_bytes = i1.read()
|
|
19
|
+
transcription = client.audio.transcriptions.create(
|
|
20
|
+
file=("audio.wav", audio_bytes),
|
|
21
|
+
model="whisper-large-v3", # High-speed transcription model
|
|
22
|
+
response_format="text"
|
|
23
|
+
)
|
|
24
|
+
st.write(f"**You said:** {transcription}")
|
|
25
|
+
|
|
26
|
+
# 2. Get AI Response using Llama 3
|
|
27
|
+
# 2. Get AI Response using the latest Llama 3.1 model
|
|
28
|
+
chat_completion = client.chat.completions.create(
|
|
29
|
+
messages=[
|
|
30
|
+
{"role": "user", "content": transcription}
|
|
31
|
+
],
|
|
32
|
+
model="llama-3.1-8b-instant", # Updated to the current supported model
|
|
33
|
+
)
|
|
34
|
+
|
|
35
|
+
ai_text = chat_completion.choices[0].message.content
|
|
36
|
+
st.write(f"**AI Response:** {ai_text}")
|
|
37
|
+
|
|
38
|
+
# 3. Text-to-Speech (TTS)
|
|
39
|
+
tts = gTTS(text=ai_text, lang='en')
|
|
40
|
+
audio_fp = io.BytesIO()
|
|
41
|
+
tts.write_to_fp(audio_fp)
|
|
42
|
+
|
|
43
|
+
st.audio(audio_fp, format="audio/mp3")
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: yf_vai
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: This package can be used to make an AI voice Assistant in just 2 lines of code.
|
|
5
|
+
Home-page: https://www.youtube.com/@YamaanFarazYFTMofficial
|
|
6
|
+
Author: Yamaan Faraz YF® official
|
|
7
|
+
Author-email: farazyamaan@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: voice ai,YF,streamlit voice ai,Yamaan Faraz YF® official package
|
|
10
|
+
Classifier: Development Status :: 3 - Alpha
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Requires-Dist: groq
|
|
19
|
+
Requires-Dist: gtts
|
|
20
|
+
Requires-Dist: streamlit
|
|
21
|
+
Dynamic: author
|
|
22
|
+
Dynamic: author-email
|
|
23
|
+
Dynamic: classifier
|
|
24
|
+
Dynamic: home-page
|
|
25
|
+
Dynamic: keywords
|
|
26
|
+
Dynamic: license
|
|
27
|
+
Dynamic: requires-dist
|
|
28
|
+
Dynamic: summary
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
yf_vai
|