Skip to content

Commit

Permalink
update gpt4all dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
adbenitez committed Sep 4, 2024
1 parent ae46ea0 commit a40f178
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 212 deletions.
209 changes: 0 additions & 209 deletions deltachat_chatbot/gpt4all.py

This file was deleted.

5 changes: 3 additions & 2 deletions deltachat_chatbot/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
SpecialContactId,
events,
)
from gpt4all import GPT4All
from rich.logging import RichHandler

from .gpt4all import GPT4All

cli = BotCli("chatbot")
cli.add_generic_option(
"--no-time",
Expand Down Expand Up @@ -119,6 +118,7 @@ def on_message(bot: Bot, accid: int, event: NewMsgEvent) -> None:
send_help(bot, accid, msg.chat_id)
return

bot.rpc.send_reaction(accid, msg.id, ["⏳"])
with gpt4all.chat_session(system_prompt=args.system_prompt or None):
bot.logger.debug(f"[chat={msg.chat_id}] Processing message={msg.id}")
load_history(bot, accid, msg.chat_id)
Expand All @@ -131,6 +131,7 @@ def on_message(bot: Bot, accid: int, event: NewMsgEvent) -> None:
took = time.time() - start
bot.logger.debug(f"[chat={msg.chat_id}] Generated reply in {took:.1f} seconds")

bot.rpc.send_reaction(accid, msg.id, [])
bot.rpc.send_msg(accid, msg.chat_id, MsgData(text=text, quoted_message_id=msg.id))


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ classifiers = [
]
dependencies = [
"deltabot-cli>=6.0.0,<7.0",
"gpt4all>=2.6.0,<3.0",
"gpt4all @ git+https://github.com/adbenitez/gpt4all.git#subdirectory=gpt4all-bindings/python",
]

[project.urls]
Expand Down

0 comments on commit a40f178

Please sign in to comment.