Simatwa / python-tgpt

AI Chat in Terminal + Package + REST-API
https://python-tgpt.onrender.com
MIT License
102 stars 15 forks source link

Is vlc really required? #49

Closed johnd0e closed 3 months ago

johnd0e commented 4 months ago

After updating to the latest version I see the following error message:

FileNotFoundError: Could not find module 'D:\AI\python-tgpt\libvlc.dll' (or one of its dependencies). Try using the full path with constructor syntax.

Is it possible to make this dependency optional?

Simatwa commented 4 months ago

Any command to reproduce this?

johnd0e commented 4 months ago

Any. E.g. pytgpt g4f update

Simatwa commented 3 months ago

I am unable to reproduce this. If you're encountering the exception when using binaries then I recommend running from source.

johnd0e commented 3 months ago

@Simatwa

Do you have vlc installed? I do not.

D:\AI\python-tgpt\src\pytgpt (main)>python __main__.py
Traceback (most recent call last):
  File "D:\AI\python-tgpt\src\pytgpt\__main__.py", line 1, in <module>
    from pytgpt.console import main
  File "D:\AI\python-tgpt\src\pytgpt\__init__.py", line 1, in <module>
    from .utils import appdir
  File "D:\AI\python-tgpt\src\pytgpt\utils.py", line 17, in <module>
    import vlc
  File "D:\AI\python-tgpt\venv\Lib\site-packages\vlc.py", line 220, in <module>
    dll, plugin_path  = find_lib()
                        ^^^^^^^^^^
  File "D:\AI\python-tgpt\venv\Lib\site-packages\vlc.py", line 180, in find_lib
    dll = ctypes.CDLL('.\\' + libname)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\xxx\AppData\Local\Programs\Python\Python312\Lib\ctypes\__init__.py", line 379, in __init__
    self._handle = _dlopen(self._name, mode)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'D:\AI\python-tgpt\src\pytgpt\libvlc.dll' (or one of its dependencies). Try using the full path with constructor syntax.
johnd0e commented 3 months ago

@Simatwa Any update?

Simatwa commented 3 months ago

On it folk.

Simatwa commented 3 months ago

I have just silenced the exception nothing much. Hope it solved that anyway?

johnd0e commented 3 months ago

@Simatwa Thank you, it is usable now.

But to be sure we need to check how it behaves when vlc is really required. Could you explain where exactly vlc intended to be used?

Simatwa commented 3 months ago

Vlc is used when you need to play the speech synthesised responses from the ai. Using the --talk-to-me flag.

monolit commented 3 months ago

Vlc is used when you need to play the speech synthesised responses from the ai. Using the --talk-to-me flag.

add mpv too