Skip to content

Commit

Permalink
feat: update click version to 8.1.3
Browse files Browse the repository at this point in the history
fix: remove unused AsyncLEO provider
fix: reduce timeout for query suggestions
test: add conditional test for audio generation
  • Loading branch information
Simatwa committed Nov 10, 2024
1 parent d4d1651 commit f7ea994
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
requests[socks]>=2.32.3
click==8.1.7
click==8.1.3
rich==13.3.4
clipman==3.1.0
pyperclip==1.8.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
]

cli_reqs = [
"click==8.1.7",
"click==8.1.3",
"rich==13.3.4",
"clipman==3.1.0",
"pyperclip==1.8.2",
Expand Down
2 changes: 0 additions & 2 deletions src/pytgpt/async_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from pytgpt.opengpt import AsyncOPENGPT
from pytgpt.openai import AsyncOPENAI
from pytgpt.llama2 import AsyncLLAMA2
from pytgpt.leo import AsyncLEO
from pytgpt.koboldai import AsyncKOBOLDAI
from pytgpt.groq import AsyncGROQ
from pytgpt.blackboxai import AsyncBLACKBOXAI
Expand All @@ -18,7 +17,6 @@
"gpt4free": AsyncGPT4FREE,
"llama2": AsyncLLAMA2,
"yepchat": AsyncYEPCHAT,
"leo": AsyncLEO,
"groq": AsyncGROQ,
"openai": AsyncOPENAI,
"novita": AsyncNOVITA,
Expand Down
2 changes: 1 addition & 1 deletion src/pytgpt/console.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ def get_completions(self, document: Document, complete_event):
)
return completions
for count, suggestion in enumerate(
suggest_query(word, timeout=10, die_silently=True),
suggest_query(word, timeout=2, die_silently=True),
start=1):
completions.append(Completion(suggestion, start_position=-len(word)))
if count >= self.suggestions_limit:
Expand Down
8 changes: 8 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,21 @@ def setUp(self):
self.audio_generator = Audio()
self.text = "This is a speech synthesis test"

@unittest.skipUnless(
os.getenv('PYTGPT_TEST_AUDIO', '')=="true",
"PYTGPT_TEST_AUDIO environment variable is not set to 'true' "
)
def test_text_to_audio(self):
"""Speech synthesis"""
voice_bytes = self.audio_generator.text_to_audio(
self.text,
)
self.assertIs(type(voice_bytes), bytes)

@unittest.skipUnless(
os.getenv('PYTGPT_TEST_AUDIO', '') == "true",
"PYTGPT_TEST_AUDIO environment variable is not set to 'true' "
)
def test_text_to_audio_save_to(self):
"""Save speech to a file"""
saved_to = self.audio_generator.text_to_audio(self.text, auto=True)
Expand Down

0 comments on commit f7ea994

Please sign in to comment.