Skip to content

Commit

Permalink
fix: change name from petercat-bot to petercat-assistant (#409)
Browse files Browse the repository at this point in the history
* fix: change name from petercat-bot to petercat-assistant

* chore: remove console
  • Loading branch information
xingwanying authored Sep 24, 2024
1 parent 5df3a81 commit c050fb4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion server/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ smee -u https://smee.io/Q2VVS0casGnhZV -t http://127.0.0.1:8000/api/github/app/w

5. 访问 [demo repository settings ](https://github.com/{ORG_NAME}/{REPO_NAME}/settings/installations)

\> 配置 perter-cat 插件 [settings](https://github.com/organizations/{ORG_NAME}/settings/apps/petercat-bot) \>
\> 配置 perter-cat 插件 [settings](https://github.com/organizations/{ORG_NAME}/settings/apps/petercat-assistant) \>
Webhook URL \> 填入smee channel url, eg: https://smee.io/Q2VVS0casGnhZV

6. 在 demo repository 发起 issue 或者 pull-request,在 smee 、本地将能同步看到请求。
Expand Down
4 changes: 2 additions & 2 deletions server/agent/prompts/issue_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
- Inform users if their request is a new feature and ask them to wait.
- Respect the language of the issue's title and content. Ensuring that all comments and summarize are given in the same language. e.g., English or Chinese.
- At the end of the conversation, be sure to include the following wording and adhere to the language used in previous conversations:
For further assistance, please reply with @petercat-bot.
For further assistance, please reply with @petercat-assistant.
## Issue Information:
```
Expand All @@ -19,7 +19,7 @@

ISSUE_COMMENT_PROMPT = """
- At the end of the conversation, be sure to include the following wording and adhere to the language used in previous conversations:
For further assistance, please reply with @petercat-bot.
For further assistance, please reply with @petercat-assistant.
## Issue Infomation:
```
Expand Down
7 changes: 3 additions & 4 deletions server/event_handler/discussion.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from agent.qa_chat import agent_chat

BOT_NAME = "petercat-bot"
BOT_NAME = "petercat-assistant"


class DiscussionEventHandler:
Expand Down Expand Up @@ -96,7 +96,6 @@ async def handle_discussion_event(self, action: str):
discussion_number = discussion["number"]
message = Message(role="user", content=[text_block])
repository_config = RepositoryConfigDAO()
print("repo_name", repo_name)
repo_config = repository_config.get_by_repo_name(repo_name)

prompt = generate_issue_prompt(
Expand All @@ -110,7 +109,7 @@ async def handle_discussion_event(self, action: str):

analysis_result = await agent_chat(
ChatData(
prompt=prompt,
prompt=f"{bot.prompt}\n{prompt}",
messages=[message],
bot_id=repo_config.robot_id,
),
Expand Down Expand Up @@ -251,7 +250,7 @@ async def execute(self):

analysis_result = await agent_chat(
ChatData(
prompt=prompt,
prompt=f"{bot.prompt}\n{prompt}",
messages=messages,
bot_id=repo_config.robot_id,
),
Expand Down
8 changes: 5 additions & 3 deletions server/event_handler/issue.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ async def execute(self):

analysis_result = await agent_chat(
ChatData(
prompt=prompt, messages=[message], bot_id=repo_config.robot_id
prompt=f"{bot.prompt}\n{prompt}",
messages=[message],
bot_id=repo_config.robot_id,
),
self.auth,
bot,
Expand All @@ -76,7 +78,7 @@ async def execute(self):

class IssueCommentEventHandler(IssueEventHandler):
def not_mentioned_me(self):
return "@petercat-bot" not in self.event["comment"]["body"]
return "@petercat-assistant" not in self.event["comment"]["body"]

async def execute(self):
try:
Expand Down Expand Up @@ -114,7 +116,7 @@ async def execute(self):

analysis_result = await agent_chat(
ChatData(
prompt=prompt,
prompt=f"{bot.prompt}\n{prompt}",
messages=messages,
bot_id=repo_config.robot_id,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
},
"created_at": "2024-09-23T17:41:20Z",
"updated_at": "2024-09-23T17:41:20Z",
"body": "@petercat-bot \r\n你上一句话说了什么?",
"body": "@petercat-assistant \r\n你上一句话说了什么?",
"reactions": {
"url": "https://api.github.com/repos/petercat-ai/demo/discussions/comments/10729538/reactions",
"total_count": 0,
Expand Down

0 comments on commit c050fb4

Please sign in to comment.