Troubleshooting Connection Issues in Python Script with Voyager and Mineflayer

51 Views Asked by At

I'm experiencing connection issues with a Python script involving Voyager and Mineflayer. The script's purpose is to enable lifelong learning through interaction with a Minecraft server. However, every time I run the script, the Mineflayer process fails to start, and I encounter a connection error.

The Script:

from langchain_openai.chat_models import ChatOpenAI
from langchain_openai.embeddings import OpenAIEmbeddings
from voyager import Voyager

openai_api_key = "YOUR_API_KEY"

voyager = Voyager(
    mc_port=3000,
    openai_api_key=openai_api_key
)

voyager.learn()

The main error I encounter is a RemoteDisconnected error, indicating that the remote end closed the connection without response. Here's the error message:

root@connor-virtual-machine:/home/connor/Voyager# python3 VOY.py
/usr/local/lib/python3.10/dist-packages/langchain/chat_models/__init__.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.chat_models import ChatOpenAI`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/langchain/chat_models/__init__.py:31: LangChainDeprecationWarning: Importing chat models from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.chat_models import ChatOpenAI`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/langchain/vectorstores/__init__.py:35: LangChainDeprecationWarning: Importing vector stores from langchain is deprecated. Importing from langchain will no longer be supported as of langchain==0.2.0. Please import from langchain-community instead:

`from langchain_community.vectorstores import Chroma`.

To install langchain-community run `pip install -U langchain-community`.
  warnings.warn(
/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: The class `langchain_community.chat_models.openai.ChatOpenAI` was deprecated in langchain-community 0.0.10 and will be removed in 0.2.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import ChatOpenAI`.
  warn_deprecated(
/usr/local/lib/python3.10/dist-packages/langchain_core/_api/deprecation.py:117: LangChainDeprecationWarning: The class `langchain_community.embeddings.openai.OpenAIEmbeddings` was deprecated in langchain-community 0.1.0 and will be removed in 0.2.0. An updated version of the class exists in the langchain-openai package and should be used instead. To use it run `pip install -U langchain-openai` and import as `from langchain_openai import OpenAIEmbeddings`.
  warn_deprecated(
Mineflayer process has exited, restarting
Subprocess mineflayer started with PID 4279.
None
/home/connor/Voyager/voyager/env/process_monitor.py:65: UserWarning: Subprocess mineflayer failed to start.
  warnings.warn(f"Subprocess {self.name} failed to start.")

I've tried updating dependencies and rewriting parts of the script based on deprecation warnings, but the issue persists. I suspect the problem might be related to how the server is set up or how the script is handling connections.

Any insights or suggestions to resolve this issue would be greatly appreciated.

0

There are 0 best solutions below