Skip to content

Commit b9bf6cc

Browse files
committed
Rename icon and move to the orresponding package
1 parent 2d5a2f0 commit b9bf6cc

File tree

8 files changed

+130
-65
lines changed

8 files changed

+130
-65
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
* Copyright 2021 Airsaid. https://github.com/airsaid
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.airsaid.localization.translate.impl.openai;
19+
20+
public class ChatGPTMessage {
21+
private String role;
22+
private String content;
23+
24+
public ChatGPTMessage(String role, String content) {
25+
this.role = role;
26+
this.content = content;
27+
}
28+
29+
public String getRole() {
30+
return role;
31+
}
32+
33+
public void setRole(String role) {
34+
this.role = role;
35+
}
36+
37+
public String getContent() {
38+
return content;
39+
}
40+
41+
public void setContent(String content) {
42+
this.content = content;
43+
}
44+
}

src/main/java/com/airsaid/localization/translate/openai_chatgpt/ChatGPTTranslator.java renamed to src/main/java/com/airsaid/localization/translate/impl/openai/ChatGPTTranslator.java

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
package com.airsaid.localization.translate.openai_chatgpt;
1+
/*
2+
* Copyright 2021 Airsaid. https://github.com/airsaid
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.airsaid.localization.translate.impl.openai;
219

320
import com.airsaid.localization.translate.AbstractTranslator;
421
import com.airsaid.localization.translate.lang.Lang;
@@ -7,16 +24,13 @@
724
import com.google.auto.service.AutoService;
825
import com.intellij.openapi.diagnostic.Logger;
926
import com.intellij.util.io.RequestBuilder;
10-
27+
import icons.PluginIcons;
1128
import org.jetbrains.annotations.NotNull;
1229
import org.jetbrains.annotations.Nullable;
1330

31+
import javax.swing.*;
1432
import java.util.List;
1533

16-
import javax.swing.Icon;
17-
18-
import icons.PluginIcons;
19-
2034

2135
@AutoService(AbstractTranslator.class)
2236
public class ChatGPTTranslator extends AbstractTranslator {
@@ -36,7 +50,7 @@ public class ChatGPTTranslator extends AbstractTranslator {
3650

3751
@Override
3852
public @Nullable Icon getIcon() {
39-
return PluginIcons.OPENAI_CHATGPT;
53+
return PluginIcons.OPENAI_ICON;
4054
}
4155

4256
@Override
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/*
2+
* Copyright 2021 Airsaid. https://github.com/airsaid
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.airsaid.localization.translate.impl.openai;
19+
20+
import java.util.List;
21+
22+
public class OpenAIRequest {
23+
private String model;
24+
private List<ChatGPTMessage> messages;
25+
26+
public OpenAIRequest(String model, List<ChatGPTMessage> messages) {
27+
this.model = model;
28+
this.messages = messages;
29+
}
30+
31+
public String getModel() {
32+
return model;
33+
}
34+
35+
public void setModel(String model) {
36+
this.model = model;
37+
}
38+
39+
public List<ChatGPTMessage> getMessages() {
40+
return messages;
41+
}
42+
43+
public void setMessages(List<ChatGPTMessage> messages) {
44+
this.messages = messages;
45+
}
46+
}

src/main/java/com/airsaid/localization/translate/openai_chatgpt/OpenAIResponse.java renamed to src/main/java/com/airsaid/localization/translate/impl/openai/OpenAIResponse.java

+18-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
package com.airsaid.localization.translate.openai_chatgpt;
1+
/*
2+
* Copyright 2021 Airsaid. https://github.com/airsaid
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*
16+
*/
17+
18+
package com.airsaid.localization.translate.impl.openai;
219

320
import java.util.List;
421

src/main/java/com/airsaid/localization/translate/openai_chatgpt/ChatGPTMessage.java

-27
This file was deleted.

src/main/java/com/airsaid/localization/translate/openai_chatgpt/OpenAIRequest.java

-29
This file was deleted.

src/main/java/icons/PluginIcons.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public interface PluginIcons {
3131
Icon MICROSOFT_ICON = load("/icons/icon_microsoft.svg");
3232
Icon ALI_ICON = load("/icons/icon_ali.svg");
3333
Icon DEEP_L_ICON = load("/icons/icon_deepl.svg");
34-
Icon OPENAI_CHATGPT = load("/icons/icon_chatgpt.svg");
34+
Icon OPENAI_ICON = load("/icons/icon_openai.svg");
3535

3636
private static Icon load(String path) {
3737
return IconLoader.getIcon(path, PluginIcons.class);

0 commit comments

Comments
 (0)