-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
331 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/test/java/com/couchbase/intellij/tree/iq/AbstractCapellaTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.couchbase.intellij.tree.iq; | ||
|
||
import com.couchbase.intellij.tree.iq.chat.ChatLinkService; | ||
import com.couchbase.intellij.tree.iq.chat.ChatLinkState; | ||
import com.couchbase.intellij.tree.iq.chat.ConfigurationPage; | ||
import com.couchbase.intellij.tree.iq.core.IQCredentials; | ||
import com.couchbase.intellij.tree.iq.settings.OpenAISettingsState; | ||
import com.couchbase.intellij.workbench.Log; | ||
|
||
public abstract class AbstractCapellaTest extends AbstractIQTest { | ||
@Override | ||
protected void setUp() throws Exception { | ||
super.setUp(); | ||
assertTrue("Please set Capella domain using `CAPELLA_DOMAIN` envvar", System.getenv().containsKey("CAPELLA_DOMAIN")); | ||
CapellaApiMethods.setCapellaDomain(System.getenv("CAPELLA_DOMAIN")); | ||
IQCredentials credentials = new IQCredentials(System.getenv("IQ_ORG_LOGIN"), System.getenv("IQ_ORG_PASSWD")); | ||
assertTrue("Please set IQ credentials using `IQ_ORG_ID`, `IQ_ORG_LOGIN`, and `IQ_ORG_PASSWD` envvars", credentials.doLogin()); | ||
String orgId = System.getenv("IQ_ORG_ID"); | ||
assertTrue("Please set IQ org id using `IQ_ORG_ID` envvar", orgId != null && orgId.length() > 0); | ||
final String iqUrl = String.format(IQ_URL, orgId); | ||
OpenAISettingsState.OpenAIConfig iqGptConfig = new OpenAISettingsState.OpenAIConfig(); | ||
OpenAISettingsState.getInstance().setGpt4Config(iqGptConfig); | ||
OpenAISettingsState.getInstance().setEnableInitialMessage(false); | ||
iqGptConfig.setApiKey(credentials.getAuth().getJwt()); | ||
iqGptConfig.setEnableStreamResponse(false); | ||
iqGptConfig.setModelName("gpt-4"); | ||
iqGptConfig.setApiEndpointUrl(iqUrl); | ||
iqGptConfig.setEnableCustomApiEndpointUrl(true); | ||
ConfigurationPage cp = iqGptConfig.withSystemPrompt(IQWindowContent::systemPrompt); | ||
Log.setLevel(3); | ||
Log.setPrinter(new Log.StdoutPrinter()); | ||
|
||
link = new ChatLinkService(getProject(), null, cp); | ||
ctx = new ChatLinkState(cp); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.