feat: support custom OpenAI-compatible service (#383)

This commit is contained in:
Carl-Robert 2024-02-23 17:41:44 +02:00 committed by GitHub
parent c8bb33d9b2
commit 8507c779b1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
27 changed files with 772 additions and 166 deletions

View file

@ -37,6 +37,7 @@ import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import okhttp3.sse.EventSource;
import org.jetbrains.annotations.NotNull;
public class GenerateGitCommitMessageAction extends AnAction {
@ -102,7 +103,7 @@ public class GenerateGitCommitMessageAction extends AnAction {
private final StringBuilder messageBuilder = new StringBuilder();
@Override
public void onMessage(String message) {
public void onMessage(String message, EventSource eventSource) {
messageBuilder.append(message);
var application = ApplicationManager.getApplication();
application.invokeLater(() ->