Skip to content

Commit

Permalink
Merge branch 'main' into chatgpt
Browse files Browse the repository at this point in the history
  • Loading branch information
sudoskys committed Feb 22, 2023
2 parents 925e83c + 6da1631 commit e85f22b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
12 changes: 5 additions & 7 deletions App/Event.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ async def load_response(self,
"""
load_csonfig()
#
_think = ThinkEngine(profile=profile)
_think = ThinkEngine(profile=self.group)
_think.register_hook(Hook(name="sad", trigger="very sad", value=3, last=60, time=int(time.time())))
_think.register_hook(Hook(name="bored", trigger="very bored", value=3, last=60, time=int(time.time())))
# 关键检查
Expand Down Expand Up @@ -360,8 +360,8 @@ async def load_response(self,
_style = None
_result = []
try:
if Detect().isQuery(_prompt.text):
_result = await prompt.build_skeleton(query=_prompt.text,
if len(_prompt.text) > 5 and Detect().isQuery(_prompt.text):
_result = await prompt.build_skeleton(query=_prompt,
llm_task="Summary Text" if len(
_prompt.text) > 20 else None,
skeleton=random.choice([SearchCraw(), DuckgoCraw()])
Expand Down Expand Up @@ -615,7 +615,7 @@ async def Group(Message: User_Message, bot_profile: ProfileReturn, config) -> Pu
restart_name=restart_name,
conversation_id=int(_cid),
)
_think = ThinkEngine(profile=conversation)
_think = ThinkEngine(profile=_chat_id)
_think.register_hook(Hook(name="happy", trigger="very happy", value=3, last=60, time=int(time.time())))
_think.register_hook(Hook(name="sad", trigger="very sad", value=4, last=120, time=int(time.time())))
_think.register_hook(Hook(name="bored", trigger="very bored", value=5, last=30, time=int(time.time())))
Expand Down Expand Up @@ -663,7 +663,6 @@ async def Group(Message: User_Message, bot_profile: ProfileReturn, config) -> Pu
auto_penalty=_csonfig["auto_adjust"],
)
# 构建
_think = ThinkEngine(profile=conversation)
_description = "📱💬|Now " + str(time.strftime("%Y/%m/%d %H:%M", time.localtime())) + "|"
_description += f" 🌙" if _think.is_night else random.choice([" 🌻", " 🌤", " 🌦"])
_description += f"\n{restart_name}-{''.join(_think.build_status(rank=20))}"
Expand Down Expand Up @@ -755,7 +754,7 @@ async def Friends(Message: User_Message, bot_profile: ProfileReturn, config) ->
restart_name=restart_name,
conversation_id=int(_cid),
)
_think = ThinkEngine(profile=conversation)
_think = ThinkEngine(profile=_chat_id)
_think.register_hook(Hook(name="happy", trigger="very happy", value=3, last=60, time=int(time.time())))
_think.register_hook(Hook(name="sad", trigger="very sad", value=4, last=120, time=int(time.time())))
_think.register_hook(Hook(name="bored", trigger="very bored", value=5, last=30, time=int(time.time())))
Expand Down Expand Up @@ -804,7 +803,6 @@ async def Friends(Message: User_Message, bot_profile: ProfileReturn, config) ->
auto_penalty=_csonfig["auto_adjust"],
)
# 构建
_think = ThinkEngine(profile=conversation)
_description = "📱💬|Now " + str(time.strftime("%Y/%m/%d %H:%M", time.localtime())) + "|"
_description += f" 🌙" if _think.is_night else random.choice([" 🌻", " 🌤", " 🌦"])
_description += f"\n{restart_name}-{''.join(_think.build_status(rank=20))}"
Expand Down
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,15 @@ python3 main.py
# run bot
pm2 start pm.json
```
monitor bot status
```
pm2 monit
```
stop bot
```
pm2 stop pm2.json
```


### 🎤 Or Run Voice Assistant

Expand Down
10 changes: 9 additions & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,14 @@ python3 main.py
# run bot
pm2 start pm.json
```
查看机器人的运行状况
```
pm2 monit
```
停止运行机器人
```
pm2 stop pm2.json
```

### 🎤 Or Run Voice Assistant

Expand Down Expand Up @@ -298,4 +306,4 @@ the [AGPL License](https://github.com/LLMKira/Openaibot/blob/main/LICENSE).

[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsudoskys%2FOpenaibot?ref=badge_large)

> 你不会相信,但是 Ai 也写了这个 Readme 的一部分
> 你不会相信,但是 Ai 也写了这个 Readme 的一部分

0 comments on commit e85f22b

Please sign in to comment.