Skip to content

Commit

Permalink
Add Minecraft extension (#1274)
Browse files Browse the repository at this point in the history
* Add minecraft extension

* use rcon

* use mcipc

* accept bytes
  • Loading branch information
Josh-XT authored Oct 29, 2024
1 parent e359c86 commit eb608f8
Show file tree
Hide file tree
Showing 2 changed files with 2,177 additions and 2 deletions.
8 changes: 6 additions & 2 deletions agixt/XT.py
Original file line number Diff line number Diff line change
Expand Up @@ -956,8 +956,12 @@ async def learn_from_file(
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
fp = os.path.normpath(file_path)
if fp.startswith(self.agent_workspace):
with open(fp, "r") as f:
content = f.read()
try:
with open(fp, "r") as f:
content = f.read()
except:
with open(fp, "rb") as f:
content = f.read()
file_content += (
f"Content from file uploaded named `{file_name}` at {timestamp}:\n"
)
Expand Down
Loading

0 comments on commit eb608f8

Please sign in to comment.