Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,16 @@ public void sendMessageToChatServer(final Command command, final ChatMessage mes
Activator.getLogger().error("Error processing ruleClick: " + e);
}
break;
case LIST_AVAILABLE_MODELS:
try {
Object listModelsResponse = amazonQLspServer.listAvailableModels(message.getData()).get();
var listModelsCommand = ChatUIInboundCommand.createCommand(ChatUIInboundCommandName.ListAvailableModels.getValue(),
listModelsResponse);
Activator.getEventBroker().post(ChatUIInboundCommand.class, listModelsCommand);
} catch (Exception e) {
Activator.getLogger().error("Error processing listAvailableModels: " + e);
}
break;
case PINNED_CONTEXT_ADD:
amazonQLspServer.pinnedContextAdd(message.getData());
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public enum ChatUIInboundCommandName {
McpServerClick("aws/chat/mcpServerClick"),
ListRules("aws/chat/listRules"),
RuleClick("aws/chat/ruleClick"),
ListAvailableModels("aws/chat/listAvailableModels"),
SendPinnedContext("aws/chat/sendPinnedContext");

private final String value;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@ <T extends Configuration> CompletableFuture<LspServerConfigurations<T>> getConfi
@JsonRequest("aws/chat/ruleClick")
CompletableFuture<Object> ruleClick(Object params);

@JsonRequest("aws/chat/listAvailableModels")
CompletableFuture<Object> listAvailableModels(Object params);

@JsonNotification("aws/chat/pinnedContextAdd")
void pinnedContextAdd(Object params);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public final void handleCommand(final ParsedCommand parsedCommand, final Browser
case RULE_CLICK:
case PINNED_CONTEXT_ADD:
case PINNED_CONTEXT_REMOVE:
case LIST_AVAILABLE_MODELS:
chatCommunicationManager.sendMessageToChatServer(command, message);
break;
case CHAT_INFO_LINK_CLICK:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public enum Command {
RULE_CLICK("aws/chat/ruleClick"),
PINNED_CONTEXT_ADD("aws/chat/pinnedContextAdd"),
PINNED_CONTEXT_REMOVE("aws/chat/pinnedContextRemove"),
LIST_AVAILABLE_MODELS("aws/chat/listAvailableModels"),
// Auth
LOGIN_BUILDER_ID("loginBuilderId"),
LOGIN_IDC("loginIdC"),
Expand Down