Working a bot for Discord
Article Start
Title: The Title
Text: Text of the article
Images: links to the images that should be drawn
Article End
The boot starts, but when you ask him a question, it’s a mistake.I prescribed printing to understand where the problem is and I understand that after Loaded data.That is, the data is loaded, and nothing works further.Error in all languages.Without discord, the script works normally.All files are in the knowledge base and the same file with the code with the coding utf-8.The problem is somewhat deeper.I am looking for a specialist who can really help.Please look at the code and then bet.The Terminal:
Detected language: UK
Loaded data.Error: 'gb2312' codec can't decode byte 0xc4 in position 28: illegal multibyte sequence
The error occurred.I took try except and wrote the print to understand more in detail what’s wrong.Here’s what is in my logos:
...Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 235, in wrapped
RET = await coro (args, kwargs)
File "/Users/artyom/Desktop/Discord Bot/bot.py", line 75, in ask
index = VectorstoreIndexCreator().from_loaders([loader])
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/indexes/vectorstore.py", line 72, in from_loaders
by docs.extend(loader.load())
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/directory.py", line 137, in load
self.load_file(i, p, docs, pbar)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/directory.py", line 94, in load_file
Raise E
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/directory.py", line 88, in load_file
sub_docs = self.loader_cls(str(item), **self.loader_kwargs).load()
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/unstructured.py", line 86, in load
elements = self._get_elements()
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/langchain/document_loaders/unstructured.py", line 171, in _get_elements
return partition(filename=self.file_path, **self.unstructured_kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/partition/auto.py", line 202, in partition
elements = partition_text(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/documents/elements.py", line 138, in wrapper
elements = func(*args, **kwargs)
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/file_utils/filetype.py", line 519, in wrapper
elements = func(*args, **kwargs)
^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/partition/text.py", line 114, in partition_text
encoding, file_text = read_txt_file(filename=filename, encoding=encoding)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/file_utils/encoding.py", line 114, in read_txt_file
formatted_encoding, file_text = detect_file_encoding(filename)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/unstructured/file_utils/encoding.py", line 92, in detect_file_encoding
file_text = byte_data.decode(encoding)
UnicodeDecodeError: 'gb2312' codec can't decode byte 0xc4 in position 28: illegal multibyte sequence
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/ext/commands/bot.py", line 1350, in invoke
await ctx.command.invoke(ctx)File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 1029, in invoke
await injected(*ctx.args, **ctx.kwargs) # type: ignore
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/discord/ext/commands/core.py", line 244, in wrapped
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: UnicodeDecodeError: 'gb2312' codec can't decode byte 0xc4 in position 28: illegal multibyte sequence
I found this - https://github.com/techleadhd/chatgpt-retrieval/issues/32#issuecomment-1666569313
I did as they say and the logs have not changed.
Make a bet if you can help with this, and write the price.
Current freelance projects in the category Bot Development
Pocket Option trading bot
71 USD
I need a bot and your expertise who has already been able to create a similar bot when the bets are correct, they are read from Pocket Option I am interested in Brent Oil I do not need a beginner or someone who will just write code for the sake of it I need someone who knows… AI & Machine Learning, Bot Development ∙ 13 hours 44 minutes back ∙ 11 proposals |
TG BOT for Auto Ria
156 USD
We are interested in creating a bot that can send 1000+ exchange offers per day from one account. Authorization through Ria login and password, with characteristics exclusively those listed on the portal. The ability to limit the number of exchange requests. Also, monitoring… Bot Development ∙ 15 hours 6 minutes back ∙ 29 proposals |
Integration of Viber in 8.3
223 USD
Need Viber integration into own CRM (1C 8.3)About the Company The company "Domofon System" is engaged in the installation and maintenance of intercom systems. Base of over 40,000 subscribers. We work on our own customized system based on 1C 8.3. We are looking for a specialist… Databases & SQL, Bot Development ∙ 16 hours 3 minutes back ∙ 8 proposals |
Development of a Telegram store for a clothing brand. Product catalog, sizes, cart, order processing.
178 USD
A Telegram channel is needed with a warehouse from the KCRM system, showing stock balances, and full payment to the IBAN account. Bot Development ∙ 2 days 2 hours back ∙ 65 proposals |
Telegram bot
266 USD
It is necessary to completely replicate the interface and functionality, but without the payment platform. It needs to be done in a short time. Bot Development ∙ 3 days 18 hours back ∙ 115 proposals |