forked from openpilot-hub/devpilot-intellij
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add model name config (openpilot-hub#21)
* add model name config * comboBox model
- Loading branch information
1 parent
adc8b85
commit 7e450c4
Showing
9 changed files
with
146 additions
and
1 deletion.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
src/main/java/com/zhongan/devpilot/enums/OpenAIModelNameEnum.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,51 @@ | ||
package com.zhongan.devpilot.enums; | ||
|
||
public enum OpenAIModelNameEnum { | ||
GPT3_5_TURBO("gpt-3.5-turbo", "gpt-3.5-turbo"), | ||
GPT3_5_TURBO_16K("gpt-3.5-turbo-16k", "gpt-3.5-turbo(16k)"), | ||
GPT4("gpt-4", "gpt-4"), | ||
GPT4_32K("gpt-4-32k", "gpt-4(32k)"), | ||
CUSTOM("custom", "Custom Model"); | ||
|
||
private String name; | ||
|
||
private String displayName; | ||
|
||
OpenAIModelNameEnum(String name, String displayName) { | ||
this.name = name; | ||
this.displayName = displayName; | ||
} | ||
|
||
public static OpenAIModelNameEnum fromName(String name) { | ||
if (name == null) { | ||
return GPT3_5_TURBO; | ||
} | ||
for (OpenAIModelNameEnum type : OpenAIModelNameEnum.values()) { | ||
if (type.getName().equals(name)) { | ||
return type; | ||
} | ||
} | ||
return GPT3_5_TURBO; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getDisplayName() { | ||
return displayName; | ||
} | ||
|
||
public void setDisplayName(String displayName) { | ||
this.displayName = displayName; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return displayName; | ||
} | ||
} |
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