feat: web search support (#641)

* feat: web search support

* fix: enable web search only for codegpt provider

* fix: checkstyle

* feat: improve list cell design
This commit is contained in:
Carl-Robert 2024-07-30 15:53:45 +03:00 committed by GitHub
parent 1f28bc6217
commit 05f146c405
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 290 additions and 77 deletions

View file

@ -173,7 +173,8 @@ public class ChatToolWindowTabPanel implements Disposable {
return new ResponsePanel()
.withReloadAction(() -> reloadMessage(message, conversation, conversationType))
.withDeleteAction(() -> removeMessage(message.getId(), conversation))
.addContent(new ChatMessageResponseBody(project, true, this));
.addContent(
new ChatMessageResponseBody(project, true, false, message.isWebSearchIncluded(), this));
}
private void reloadMessage(
@ -244,7 +245,7 @@ public class ChatToolWindowTabPanel implements Disposable {
requestHandler.call(callParameters);
}
private Unit handleSubmit(String text) {
private Unit handleSubmit(String text, boolean webSearchIncluded) {
var message = new Message(text);
var editor = EditorUtil.getSelectedEditor(project);
if (editor != null) {
@ -257,6 +258,7 @@ public class ChatToolWindowTabPanel implements Disposable {
}
}
message.setUserMessage(text);
message.setWebSearchIncluded(webSearchIncluded);
sendMessage(message, ConversationType.DEFAULT);
return Unit.INSTANCE;
}