-
Notifications
You must be signed in to change notification settings - Fork 0
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
MARP-747:Improve the explanatory dialog and pimp the documentation. #77
MARP-747:Improve the explanatory dialog and pimp the documentation. #77
Conversation
…nector into feature/MARP-747-ChatGPT-assistant-Not-possible-to-mark-only-one-word-in-xhtlm-code
private String sendRequest(String context, String question, boolean includeSystemPrompt) { | ||
WebTarget chat = client.get().path("chat/completions"); | ||
ArrayNode arrayNode = JsonNodeFactory.instance.arrayNode(); | ||
arrayNode.add(message("system", SYSTEM_PROMPT)); | ||
if (includeSystemPrompt) { | ||
arrayNode.add(message("system", SYSTEM_PROMPT)); | ||
} | ||
arrayNode.add(message("user", String.format("%s \n\n %s", context, question))); | ||
ObjectNode request = completion().set("messages", arrayNode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why no test on this rest-centered feature which is easy to re-produce in junit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @ivy-rew
I would handle what Linh is working on from now. We are so sorry for this delay due to some critical issue regarding to marketplace website.
For the testing, we found no function from openai-assistant were tested.
Could we create a separated test project for open-ai-assistant or include it to the recent project?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
HI @ntqdinh-axonivy
Sorry this didn't reach me. Please make sure you'll use the common team chat if you receive no answer for concrete requests. Otherwise request get lost simply by me being on vacation or something alike.
Answering the question however, there are already rest-centric tests which could easily be extended: https://github.com/axonivy-market/openai-connector/blob/master/openai-connector-test/src_test/com/axonivy/connector/openai/test/AiAssistanceTest.java
... also the utility method in here could be refactored and tested very simply within the existing testing project. So I wouldn't introduce a new test-project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your hint @ivy-rew
I will update the test cases for these changes soon.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, please keep the test-coverage in mind -> it's always difficult to review PR on stories you weren't involved without seeing tests asserting the expected behavior.
Hi @ivy-rew |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good feature, enhanced generalization of test-dialogs, nice test coverage. ⭐
// Get Eclipse theme colors | ||
Color bgColor = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_BACKGROUND_COLOR); | ||
Color fgColor = JFaceResources.getColorRegistry().get(JFacePreferences.CONTENT_ASSIST_FOREGROUND_COLOR); | ||
|
||
// Create CSS with Eclipse colors | ||
String css = String.format("body { background-color: %s; color: %s; font-family: '%s'; }", toHex(bgColor.getRGB()), | ||
toHex(fgColor.getRGB()), JFaceResources.getTextFont().getFontData()[0].getName()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the logic here is getting larger and harder to maintain, rather than adding comments,
I'd extract this CSS setup and it's colors to its own method #getEclipseCss()
- Extract dialog css set up to separated method
No description provided.