Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft PR for exception GPT analyze #537

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

DexterDreeeam
Copy link
Contributor

Draft PR for exception GPT analyze

Linked GitHub issue ID: #

Pull Request Checklist

  • Tests for the changes have been added (for bug fixes / features)
  • Code compiles correctly with all tests are passed.
  • I've read the contributing guide and followed the recommended practices.
  • Wikis or README have been reviewed and added / updated if needed (for bug fixes / features)

Does this introduce a breaking change?

If this introduces a breaking change for Hydra Lab users, please describe the impact and migration path.

  • Yes
  • No

How you tested it

Please make sure the change is tested, you can test it by adding UTs, do local test and share the screenshots, etc.

Please check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Technical design
  • Build related changes
  • Refactoring (no functional changes, no api changes)
  • Code style update (formatting, renaming) or Documentation content changes
  • Other (please describe):

Feature UI screenshots or Technical design diagrams

If this is a relatively large or complex change, kick it off by drawing the tech design with PlantUML and explaining why you chose the solution you did and what alternatives you considered, etc...


import java.util.Arrays;

public class GptSuggestionService {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • 请用UT来示例使用方法
  • 请增加模板文件来存放prompt

" 3. Propose potential solution to fix this exception.\n";

String ExceptionAnalyze(String exceptionStr, String logPath) {
client = new AzureOpenAIServiceClient(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不应该在方法中实例化这个类

" 1. Give me a summary about this exception.\n" +
" 2. Assume root cause of this exception.\n" +
" 3. Propose potential solution to fix this exception.\n";

Copy link
Member

@hydraxman hydraxman Jul 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

上面的prompt是最终版的么?看起来也是过于简单。可以参考 https://www.bilibili.com/video/BV1jm4y1y7rA 学习prompt技巧

String logContent = "";
ChatRequest req = new ChatRequest();
req.setMessages(Arrays.asList(
new ChatMessage("system", exceptionAnalyzePrompt),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么prompt通过system身份传入?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants