Skip to content

Commit

Permalink
Fix PEP9
Browse files Browse the repository at this point in the history
  • Loading branch information
sunwaterdev committed Jul 7, 2024
1 parent 38083e6 commit ecc58e7
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 17 deletions.
8 changes: 0 additions & 8 deletions lidya/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@


def listen_and_repeat(last_communication):
"""AI is creating summary for listen_and_repeat
Args:
last_communication ([type]): [description]
Returns:
[type]: [description]
"""
with sr.Microphone() as source:
audio = r.listen(source)
user_message = r.recognize_google(audio, language=CONF.get_lang())
Expand Down
12 changes: 8 additions & 4 deletions lidya/libs/llm_con.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ class Connector:

def __init__(self, model, service, api_key, prompt):
"""
Initialize the instance. This is the method that must be called by the user when interacting with OpenAI
Initialize the instance. This is the method that must be called by
the user when interacting with OpenAI
@param model - Model to use for access
@param service - Service to use for access
Expand All @@ -35,11 +36,13 @@ def __init__(self, model, service, api_key, prompt):

def interact(self, message):
"""
Interact with the LLM. This is a method to be called by the user when they want to interact with the LLM
Interact with the LLM. This is a method to be called by the
user when they want to interact with the LLM
@param message - The message that will be displayed to the user
@return The user's response to the user or None if there is no response to the inputted message
@return The user's response to the user or None if there is
no response to the inputted message
"""
"""Interact with the LLM"""
# Create a new message in the chat.
Expand All @@ -54,7 +57,8 @@ def interact(self, message):

def reset(self):
"""
Reset the history to the default state. This is called when the user presses the reset button in the service
Reset the history to the default state. This is called
when the user presses the reset button in the service
"""
"""Reset messages history."""
# This method is called when the service is openai
Expand Down
15 changes: 10 additions & 5 deletions lidya/libs/tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class TTS:

def __init__(self, lang, voice):
"""
Initialize the Dimits object. This is the constructor for the Vehicle class. You need to call this before you use the Vehicle class.
Initialize the Dimits object. This is the constructor for the Vehicle class.
You need to call this before you use the Vehicle class.
@param lang - language of the voice e. g. " de "
@param voice - voice of the voice e. g. " mus
Expand All @@ -25,12 +26,15 @@ def __init__(self, lang, voice):

def generate_audio(self, text, location):
"""
Generate and save audio file. This method is used to generate a sound file from text. The file is saved to location
Generate and save audio file. This method is used to generate a sound file
from text. The file is saved to location
@param text - text to be played in sound file
@param location - location where to save sound file. It will be saved to this location
@param location - location where to save sound file. It will be saved to
this location
@return location where audio file was saved to. It will be saved to this location after completion of the program
@return location where audio file was saved to. It will be saved to this
location after completion of the program
"""
self.dt.text_2_audio_file(
text, location.split("/")[-1], "/".join(location.split("/")[0:-1])
Expand All @@ -39,7 +43,8 @@ def generate_audio(self, text, location):

def play_generate_audio(self, text):
"""
Play a generated audio. This is a convenience method for use in tests that want to play audio from a text that has been generated by the user
Play a generated audio. This is a convenience method for use in tests that want to
play audio from a text that has been generated by the user
@param text - The text that should be
"""
Expand Down

0 comments on commit ecc58e7

Please sign in to comment.