Giter Site home page Giter Site logo

Unable to import client about llmchat HOT 14 CLOSED

etvoight avatar etvoight commented on August 21, 2024
Unable to import client

from llmchat.

Comments (14)

hc20k avatar hc20k commented on August 21, 2024

No worries! Did you install the dependencies from requirements.txt? The script requires a fork of discord.py with voice support. You can install it manually with: pip install git+https://github.com/Sheepposu/discord.py@voice-receive

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Looks like that solved that problem, thank you! I just tried testing the bot using the "/info" command within the Discord server. I'm getting the below error message and in Discord it's saying the bot is not responding.

Any ideas/help with this?

[04-24 18:47:01] [tree.py:798] ERROR - Ignoring exception in command 'info'
Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/configparser.py", line 790, in get
    value = d[option]
  File "/usr/local/python/3.10.4/lib/python3.10/collections/__init__.py", line 986, in __getitem__
    return self.__missing__(key)            # support subclasses that define __missing__
  File "/usr/local/python/3.10.4/lib/python3.10/collections/__init__.py", line 978, in __missing__
    raise KeyError(key)
KeyError: 'reminder'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/app_commands/commands.py", line 841, in _do_call
    return await self._callback(self.binding, interaction, **params)  # type: ignore
  File "/workspaces/Discord-Chatbot/llmchat/client.py", line 286, in print_info
    value=self.config.bot_reminder if self.config.bot_reminder is not None else "*Not set!*",
  File "/workspaces/Discord-Chatbot/llmchat/config.py", line 214, in bot_reminder
    return self._config.get("Bot", "reminder")
  File "/usr/local/python/3.10.4/lib/python3.10/configparser.py", line 793, in get
    raise NoOptionError(option, section)
configparser.NoOptionError: No option 'reminder' in section: 'Bot'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/app_commands/tree.py", line 1248, in _call
    await command._invoke_with_namespace(interaction, namespace)
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/app_commands/commands.py", line 867, in _invoke_with_namespace
    return await self._do_call(interaction, transformed_values)
  File "/usr/local/python/3.10.4/lib/python3.10/site-packages/discord/app_commands/commands.py", line 860, in _do_call
    raise CommandInvokeError(self, e) from e
discord.app_commands.errors.CommandInvokeError: Command 'info' raised an exception: NoOptionError: No option 'reminder' in section: 'Bot'

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

Ah yes, this is a bug with the config parser. I'll push an update soon to fix this, but for now you can add reminder = in the [Bot] category and the error should go away.

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Awesome! Your fixes have worked, thank you again.

The (hopefully) last issue I'm running into is that the voice Discord is reading responses in is still the default Discord TTS voice and not the Eleven Labs voice I have created. I've added my Eleven Labs API key as well as the voice ID for the voice I want to use but that hasn't seemed to work.

Is there another configuration I have missed?

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

The ElevenLabs TTS doesn't replace the default discord tts, you have to join a voice channel and the bot will join after you. If you want the bot to just read its replies and ignore your voice, set Bot.audiobook_mode to true. :) Let me know if that works for you!

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Oh ok got it. Sorry, misunderstood how it worked!

I've got the bot responding to messages, but it's still not using my Eleven Labs voice. I think it may have to do with this error I'm seeing when I install the requirements.txt.

Building wheels for collected packages: PyAudio
  Building wheel for PyAudio (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for PyAudio (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [18 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-cpython-310
      creating build/lib.linux-x86_64-cpython-310/pyaudio
      copying src/pyaudio/__init__.py -> build/lib.linux-x86_64-cpython-310/pyaudio
      running build_ext
      building 'pyaudio._portaudio' extension
      creating build/temp.linux-x86_64-cpython-310
      creating build/temp.linux-x86_64-cpython-310/src
      creating build/temp.linux-x86_64-cpython-310/src/pyaudio
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I/usr/local/include -I/usr/include -I/usr/local/python/3.10.4/include/python3.10 -c src/pyaudio/device_api.c -o build/temp.linux-x86_64-cpython-310/src/pyaudio/device_api.o
      src/pyaudio/device_api.c:9:10: fatal error: portaudio.h: No such file or directory
          9 | #include "portaudio.h"
            |          ^~~~~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for PyAudio
Failed to build PyAudio
ERROR: Could not build wheels for PyAudio, which is required to install pyproject.toml-based projects

I've been trying a bunch of different fixes I've found online but no luck. Any guidance?

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

Since you're on linux, you have to install portaudio19-dev using your package manager and it should work after :) It's a dependency of pyaudio

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Weird, I'm on Windows 10. Do you know why that error is being thrown since I'm not on Linux?

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

Weird, I'm on Windows 10. Do you know why that error is being thrown since I'm not on Linux?

Wait really? Are you using WSL?

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Negative. Vanilla Windows 10, running the code through Github Codespaces. Could that have something to do with it? Should I try running the code using a different environment?

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

Ah yes that would be it, I'm pretty sure they run Linux. If you can install portaudio19-dev on the codespaces machine that should fix the error, or you can clone it locally and try running it on your Windows 10 machine

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

Running it locally has fixed that issue! I've got the bot working correctly in audiobook mode on a private Discord server.

Two things I've faced now that it's responding:

  1. I haven't been able to get it to respond to my voice (assuming it's supposed to based on my understanding of your documentation). I've tried different microphones and have given the bot basically every permission in Discord.
  2. The Discord default TTS voice is playing overtop of the ElevenLabs voice. I've disabled TTS readouts in Discord's accessibility settings, but the robotic TTS voice is still playing.

Any ideas about those two points?

from llmchat.

etvoight avatar etvoight commented on August 21, 2024

@hc20k Disregard the second question, I figured that one out. Turns out there's a separate setting in Discord to enable TTS for notifications, which is what was being triggered.

from llmchat.

hc20k avatar hc20k commented on August 21, 2024

Running it locally has fixed that issue! I've got the bot working correctly in audiobook mode on a private Discord server.

Two things I've faced now that it's responding:

  1. I haven't been able to get it to respond to my voice (assuming it's supposed to based on my understanding of your documentation). I've tried different microphones and have given the bot basically every permission in Discord.
  2. The Discord default TTS voice is playing overtop of the ElevenLabs voice. I've disabled TTS readouts in Discord's accessibility settings, but the robotic TTS voice is still playing.

Any ideas about those two points?

Hmm, for your first issue, which TTS service are you using? I find that whisper works really well compared to google.

from llmchat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.