mirror of
https://github.com/carlrobertoh/ProxyAI.git
synced 2026-04-28 19:52:17 +00:00
You API integration (#203)
* Ability to configure custom service * Add example preset templates, rename module * Custom service client impl * Add YOU API integration * Remove/ignore generated antlr classes * Remove text completion models(deprecated) * Remove unused code, fix settings state sync * Display model name/icon in the tool window * Update chat history UI * Fix model/service sync * Clear plugin state * Fix minor bugs, add settings sync tests * UI changes * Separate model configuration * Add support for overriding the completion path * Update Find Bugs prompt
This commit is contained in:
parent
a860054360
commit
37af74ebdf
125 changed files with 1673 additions and 1537 deletions
|
|
@ -0,0 +1,36 @@
|
|||
package ee.carlrobert.codegpt.toolwindow;
|
||||
|
||||
import com.intellij.ui.components.JBLabel;
|
||||
import com.intellij.util.ui.JBFont;
|
||||
import ee.carlrobert.codegpt.Icons;
|
||||
import ee.carlrobert.llm.client.openai.completion.chat.OpenAIChatCompletionModel;
|
||||
import java.util.NoSuchElementException;
|
||||
import javax.swing.SwingConstants;
|
||||
|
||||
public class ModelIconLabel extends JBLabel {
|
||||
|
||||
public ModelIconLabel(String clientCode, String modelCode) {
|
||||
if ("you.chat.completion".equals(clientCode)) {
|
||||
setIcon(Icons.YouIcon);
|
||||
return;
|
||||
}
|
||||
|
||||
if ("chat.completion".equals(clientCode)) {
|
||||
setIcon(Icons.OpenAIIcon);
|
||||
}
|
||||
if ("azure.chat.completion".equals(clientCode)) {
|
||||
setIcon(Icons.AzureIcon);
|
||||
}
|
||||
setText(formatModelName(modelCode));
|
||||
setFont(JBFont.small().asBold());
|
||||
setHorizontalAlignment(SwingConstants.LEADING);
|
||||
}
|
||||
|
||||
private String formatModelName(String modelCode) {
|
||||
try {
|
||||
return OpenAIChatCompletionModel.findByCode(modelCode).getDescription();
|
||||
} catch (NoSuchElementException e) {
|
||||
return modelCode;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue