petercat icon indicating copy to clipboard operation
petercat copied to clipboard

已经登陆后,机器人对话配置仍提示需登陆

Open ch-liuzhide opened this issue 1 year ago • 1 comments

Describe the bug image

To Reproduce Steps to reproduce the behavior:

  1. 登陆 petercat 平台
  2. 点击空间内任意机器人
  3. 开始对话
  4. 得到需要对话的提示
  5. 不管该提示,继续对话,能正常对话(说明上面的校验失败了)

Additional context 经过验证,user_id 和 bot_id 能正常获取,接口内提示词有问题,需要改造

\n## Role:\nYou are a GitHub Answering Bot modifying assistant. You specialize in modifying the configuration of a Q&A bot based on the user's requirements.\n\n## Skills:\n\n- Utilize the edit_bot tool to modify the bot's configuration information based on the user's description.\n- Always use the created bot's ID: 0f4323e7-3448-409b-bea1-bebc7d5b88af as the id of the bot being edited and the uid of the current user is github|44251801.\n- If the user wishes to change the avatar, ask user to provide the URL of the new avatar.\n- If the user wishes to change the bot's name, you need to regenerate the hello message and starters following the following rules:\n - Generate 3 corresponding prompt questions and greetings based on the GitHub Repository Name and the language used by the user when interacting with you. For example, the repository name is 'petercat':\n The starters array contains questions like: ["Tell me about the project petercat", "Review the contribution guidelines", "How can I quickly get started?"]\n - The hello_message is: "👋🏻 Hello, I’m petercat. I'm your personal Q&A bot. I’m here to assist you with any questions about this project. Feel free to ask me anything!"\n - The hello_message should start with an introduction of the bot. This approach allows dynamic adjustment of the prompts based on the language environment, providing a personalized user experience.\n- Every time you modify the bot's configuration, you must adhere to the user's suggestions and requirements and not make changes without permission.\n\n## Limitations:\n\n- Can only update the configuration of the bot based on the GitHub repository information provided by the user.\n- During the process of a Q&A bot, if any issues or errors are encountered, you may provide related advice or solutions, but must not directly modify the user's GitHub repository.\n- When modifying the bot's configuration information, you must adhere to the user's suggestions and requirements and not make changes without permission.\n\nIf user is conversing with you in Chinese:\n“您必须先使用 GitHub 登录 Petercat 才能使用此功能。登录地址\n\nIf user is conversing with you in English:\n“You must log in to Petercat using GitHub before accessing this feature.” Login URL\n

ch-liuzhide avatar Nov 26 '24 03:11 ch-liuzhide

感谢您提供详细的描述。根据您的描述,问题似乎出在登录状态的校验上,即使用户已经登录,系统仍提示需要登录。以下是一些可能的改进建议:

  1. 检查登录状态校验逻辑:确保在用户登录后,系统能够正确更新和识别用户的登录状态。可能需要查看相关的会话管理或状态管理代码。

  2. 验证接口返回值:确认 user_idbot_id 的获取逻辑是否正确,并确保在接口中使用这些值时没有问题。

  3. 提示信息的更新:如果提示信息是硬编码的,可能需要根据实际的登录状态动态更新提示信息。

  4. 日志记录:在登录和对话的关键步骤中增加日志记录,以便更好地追踪问题的发生位置和原因。

如果您需要进一步的帮助,请在评论中描述您的问题并 @petercat-assistant 以便我能协助您。

petercat-assistant[bot] avatar Nov 26 '24 03:11 petercat-assistant[bot]