Skip to content

Commit 357f176

Browse files
committed
feat: update model options in info.json
1 parent bd4c66e commit 357f176

File tree

4 files changed

+23
-28
lines changed

4 files changed

+23
-28
lines changed

.github/workflows/release.yaml

+1-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ jobs:
2222
- uses: actions/checkout@v4
2323
with:
2424
fetch-depth: 0
25-
token: ${{ secrets.PAT }}
2625

2726
- name: Set up Git
2827
run: |
@@ -80,7 +79,7 @@ jobs:
8079
- name: Push changes
8180
uses: ad-m/github-push-action@master
8281
with:
83-
github_token: ${{ secrets.PAT }}
82+
github_token: ${{ github.token }}
8483
tags: true
8584

8685
- name: Upload binaries to release

public/info.json

+11-15
Original file line numberDiff line numberDiff line change
@@ -56,35 +56,31 @@
5656
"identifier": "model",
5757
"type": "menu",
5858
"title": "模型",
59-
"defaultValue": "gpt-3.5-turbo",
59+
"defaultValue": "gpt-4.1-nano",
6060
"menuValues": [
6161
{
6262
"title": "Custom",
6363
"value": "custom"
6464
},
6565
{
66-
"title": "GPT-3.5 Turbo",
67-
"value": "gpt-3.5-turbo"
66+
"title": "GPT-4.1",
67+
"value": "gpt-4.1"
6868
},
6969
{
70-
"title": "GPT-4",
71-
"value": "gpt-4"
70+
"title": "GPT-4.1 mini",
71+
"value": "gpt-4.1-mini"
7272
},
7373
{
74-
"title": "GPT-4o",
75-
"value": "gpt-4o"
76-
},
77-
{
78-
"title": "GPT-4o mini",
79-
"value": "gpt-4o-mini"
74+
"title": "GPT-4.1 nano",
75+
"value": "gpt-4.1-nano"
8076
},
8177
{
82-
"title": "GPT-4 Turbo",
83-
"value": "gpt-4-turbo"
78+
"title": "GPT-4o",
79+
"value": "gpt-4o"
8480
},
8581
{
86-
"title": "GPT-4 32K",
87-
"value": "gpt-4-32k"
82+
"title": "o4-mini",
83+
"value": "o4-mini"
8884
}
8985
]
9086
},

src/types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,11 @@ interface Model {
8888
owned_by: string;
8989
}
9090

91+
export interface LanguagePrompt {
92+
prompt: string;
93+
detailed: string;
94+
}
95+
9196
export interface ModelList {
9297
object: string,
9398
data: Model[]

src/utils.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
1+
import { HttpResponse, ServiceError, TextTranslateQuery, ValidationCompletion } from "@bob-translate/types";
12
import { HTTP_ERROR_CODES } from "./const";
2-
import type {
3-
BobHttpResponse,
4-
BobServiceError,
5-
BobTranslateQuery,
6-
BobValidateCompletion
7-
} from "./types";
83

94
function buildHeader(isAzureServiceProvider: boolean, apiKey: string): {
105
"Content-Type": string;
@@ -34,8 +29,8 @@ function getApiKey(apiKeys: string): string {
3429
}
3530

3631
function handleGeneralError(
37-
query: BobTranslateQuery,
38-
error: BobServiceError | BobHttpResponse
32+
query: TextTranslateQuery,
33+
error: ServiceError | HttpResponse
3934
) {
4035
if ("response" in error) {
4136
// Handle HTTP response error
@@ -61,8 +56,8 @@ function handleGeneralError(
6156
}
6257

6358
function handleValidateError(
64-
completion: BobValidateCompletion,
65-
error: BobServiceError
59+
completion: ValidationCompletion,
60+
error: ServiceError
6661
) {
6762
completion({
6863
result: false,
@@ -76,7 +71,7 @@ function handleValidateError(
7671

7772
function replacePromptKeywords(
7873
prompt: string,
79-
query: BobTranslateQuery
74+
query: TextTranslateQuery
8075
): string {
8176
if (!prompt) return prompt;
8277
return prompt

0 commit comments

Comments
 (0)