plugin-ai-api 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +51 -12
- package/dist/client/185.c47663fefaeb0e5b.js +10 -0
- package/dist/client/562.9012cfd1fa04303d.js +10 -0
- package/dist/client/685.b5b1e0a5b825d253.js +10 -0
- package/dist/client/index.js +1 -1
- package/dist/client-v2/185.b552dc91ec2371ba.js +10 -0
- package/dist/client-v2/562.db2984167250b1be.js +10 -0
- package/dist/client-v2/685.cf16e5b829e06f85.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/externalVersion.js +8 -8
- package/dist/locale/en-US.json +175 -139
- package/dist/locale/vi-VN.json +40 -2
- package/dist/locale/zh-CN.json +40 -2
- package/dist/server/collections/ai-api-model-metadata.js +26 -0
- package/dist/server/collections/ai-api-response-records.js +101 -0
- package/dist/server/collections/ai-api-virtual-models.js +68 -0
- package/dist/server/middleware/response-record-resource.js +66 -0
- package/dist/server/middleware/role-permission.js +43 -18
- package/dist/server/migrations/20260901000000-remove-default-group-members.js +60 -0
- package/dist/server/migrations/20260902000000-seed-default-role-permissions.js +55 -0
- package/dist/server/migrations/20260903000000-seed-sample-response-records.js +170 -0
- package/dist/server/plugin.js +66 -16
- package/dist/server/routes/chat-completions.js +38 -6
- package/dist/server/routes/completions.js +16 -4
- package/dist/server/routes/embeddings.js +25 -6
- package/dist/server/routes/models.js +29 -0
- package/dist/server/routes/responses.js +530 -0
- package/dist/server/routes/router.js +65 -10
- package/dist/server/usage.js +25 -4
- package/dist/server/utils/direct-llm-context.js +1 -1
- package/dist/server/utils/resolve-service.js +24 -0
- package/dist/server/utils/response-store.js +138 -0
- package/dist/server/utils/responses-format.js +686 -0
- package/dist/server/utils/responses-stream.js +330 -0
- package/dist/server/utils/virtual-models.js +238 -0
- package/dist/server/validation.js +44 -2
- package/dist/swagger.js +137 -0
- package/package.json +34 -32
- package/src/__tests__/locale.test.ts +43 -0
- package/src/client/__tests__/settings-registration.test.tsx +1 -0
- package/src/client/plugin.tsx +9 -1
- package/src/client-v2/__tests__/settings-registration.test.tsx +1 -0
- package/src/client-v2/pages/ModelMetadataPage.tsx +44 -0
- package/src/client-v2/pages/ModelRoutingPage.tsx +238 -0
- package/src/client-v2/pages/UsageGroupsPage.tsx +75 -38
- package/src/client-v2/plugin.tsx +8 -0
- package/src/locale/en-US.json +175 -139
- package/src/locale/vi-VN.json +40 -2
- package/src/locale/zh-CN.json +40 -2
- package/src/server/__tests__/embeddings.test.ts +184 -0
- package/src/server/__tests__/models.test.ts +21 -1
- package/src/server/__tests__/response-record-resource.test.ts +50 -0
- package/src/server/__tests__/response-store-integration.test.ts +341 -0
- package/src/server/__tests__/response-store.test.ts +195 -0
- package/src/server/__tests__/responses-contract.test.ts +469 -0
- package/src/server/__tests__/responses-format.test.ts +299 -0
- package/src/server/__tests__/responses-router.test.ts +182 -0
- package/src/server/__tests__/responses-streaming.test.ts +368 -0
- package/src/server/__tests__/responses.test.ts +462 -0
- package/src/server/__tests__/role-permission.test.ts +139 -0
- package/src/server/__tests__/seed-role-permission.test.ts +88 -0
- package/src/server/__tests__/types/responses-sdk.types.test-d.ts +23 -0
- package/src/server/__tests__/usage-groups.test.ts +96 -0
- package/src/server/__tests__/usage-route.test.ts +1 -0
- package/src/server/__tests__/usage.test.ts +14 -0
- package/src/server/__tests__/validation.test.ts +66 -7
- package/src/server/__tests__/virtual-model-routing.test.ts +589 -0
- package/src/server/collections/ai-api-model-metadata.ts +26 -0
- package/src/server/collections/ai-api-response-records.ts +77 -0
- package/src/server/collections/ai-api-virtual-models.ts +58 -0
- package/src/server/middleware/response-record-resource.ts +44 -0
- package/src/server/middleware/role-permission.ts +69 -35
- package/src/server/migrations/20260901000000-remove-default-group-members.ts +56 -0
- package/src/server/migrations/20260902000000-seed-default-role-permissions.ts +46 -0
- package/src/server/migrations/20260903000000-seed-sample-response-records.ts +162 -0
- package/src/server/plugin.ts +84 -20
- package/src/server/resource/ai-api-config.ts +2 -1
- package/src/server/routes/agent-completions.ts +3 -0
- package/src/server/routes/chat-completions.ts +34 -10
- package/src/server/routes/completions.ts +16 -4
- package/src/server/routes/embeddings.ts +32 -10
- package/src/server/routes/models.ts +34 -0
- package/src/server/routes/responses.ts +640 -0
- package/src/server/routes/router.ts +81 -12
- package/src/server/services/__tests__/file-processor.test.ts +1 -0
- package/src/server/usage.ts +29 -2
- package/src/server/utils/app-observability.ts +1 -1
- package/src/server/utils/direct-llm-context.ts +2 -1
- package/src/server/utils/openai-format.ts +1 -0
- package/src/server/utils/resolve-service.ts +39 -1
- package/src/server/utils/response-store.ts +148 -0
- package/src/server/utils/responses-format.ts +974 -0
- package/src/server/utils/responses-stream.ts +384 -0
- package/src/server/utils/virtual-models.ts +320 -0
- package/src/server/validation.ts +49 -0
- package/src/swagger.ts +139 -0
- package/dist/client/562.44b16aad4718b4c7.js +0 -10
- package/dist/client/685.ae483e17b6b49c98.js +0 -10
- package/dist/client-v2/562.45d5c504433be38b.js +0 -10
- package/dist/client-v2/685.1030370b309b7d4b.js +0 -10
- package/dist/server/collections/ai-api-user-permissions.js +0 -67
- package/dist/server/collections/ai-api-user-quota-buckets.js +0 -54
- package/dist/server/collections/ai-api-user-quota-policies.js +0 -63
- package/dist/server/resource/ai-api-usage-groups.js +0 -168
- package/src/server/collections/ai-api-user-permissions.ts +0 -46
- package/src/server/collections/ai-api-user-quota-buckets.ts +0 -24
- package/src/server/collections/ai-api-user-quota-policies.ts +0 -33
- package/src/server/resource/ai-api-usage-groups.ts +0 -171
package/dist/locale/en-US.json
CHANGED
|
@@ -1,139 +1,175 @@
|
|
|
1
|
-
{
|
|
2
|
-
"AI API Gateway": "AI API Gateway",
|
|
3
|
-
"Configuration": "Configuration",
|
|
4
|
-
"Default AI Employee": "Default AI Employee",
|
|
5
|
-
"Enabled LLM Services": "Enabled LLM Services",
|
|
6
|
-
"Rate Limit": "Rate Limit",
|
|
7
|
-
"Save Configuration": "Save Configuration",
|
|
8
|
-
"Configuration saved": "Configuration saved",
|
|
9
|
-
"Failed to save configuration": "Failed to save configuration",
|
|
10
|
-
"API mode": "API mode",
|
|
11
|
-
"Direct LLM": "Direct LLM",
|
|
12
|
-
"AI Employee agent": "AI Employee agent",
|
|
13
|
-
"Default LLM service": "Default LLM service",
|
|
14
|
-
"Enable user quotas": "Enable user quotas",
|
|
15
|
-
"Default reserved output tokens": "Default reserved output tokens",
|
|
16
|
-
"Refresh": "Refresh",
|
|
17
|
-
"Model pricing": "Model pricing",
|
|
18
|
-
"User quotas": "User quotas",
|
|
19
|
-
"Usage": "Usage",
|
|
20
|
-
"LLM service": "LLM service",
|
|
21
|
-
"Model": "Model",
|
|
22
|
-
"Input price / 1M": "Input price / 1M",
|
|
23
|
-
"Cache input price / 1M": "Cache input price / 1M",
|
|
24
|
-
"Output price / 1M": "Output price / 1M",
|
|
25
|
-
"Fixed request cost": "Fixed request cost",
|
|
26
|
-
"Currency": "Currency",
|
|
27
|
-
"Status": "Status",
|
|
28
|
-
"Enabled": "Enabled",
|
|
29
|
-
"Disabled": "Disabled",
|
|
30
|
-
"Actions": "Actions",
|
|
31
|
-
"Edit": "Edit",
|
|
32
|
-
"Delete": "Delete",
|
|
33
|
-
"Delete this price?": "Delete this price?",
|
|
34
|
-
"Add price": "Add price",
|
|
35
|
-
"Edit price": "Edit price",
|
|
36
|
-
"Effective from": "Effective from",
|
|
37
|
-
"Effective to": "Effective to",
|
|
38
|
-
"Notes": "Notes",
|
|
39
|
-
"Saved successfully": "Saved successfully",
|
|
40
|
-
"Deleted successfully": "Deleted successfully",
|
|
41
|
-
"User": "User",
|
|
42
|
-
"Period": "Period",
|
|
43
|
-
"Request limit": "Request limit",
|
|
44
|
-
"Token limit": "Token limit",
|
|
45
|
-
"Cost limit": "Cost limit",
|
|
46
|
-
"Timezone": "Timezone",
|
|
47
|
-
"Unlimited": "Unlimited",
|
|
48
|
-
"Add quota": "Add quota",
|
|
49
|
-
"Edit quota": "Edit quota",
|
|
50
|
-
"Delete this quota?": "Delete this quota?",
|
|
51
|
-
"Daily": "Daily",
|
|
52
|
-
"Monthly": "Monthly",
|
|
53
|
-
"Reject unpriced models": "Reject unpriced models",
|
|
54
|
-
"Missing usage behavior": "Missing usage behavior",
|
|
55
|
-
"Use reserved estimate": "Use reserved estimate",
|
|
56
|
-
"Allow without token charge": "Allow without token charge",
|
|
57
|
-
"Context overflow behavior": "Context overflow behavior",
|
|
58
|
-
"Reject request": "Reject request",
|
|
59
|
-
"Truncate oldest conversation turns": "Truncate oldest conversation turns",
|
|
60
|
-
"Started at": "Started at",
|
|
61
|
-
"Requested model": "Requested model",
|
|
62
|
-
"Resolved service": "Resolved service",
|
|
63
|
-
"Resolved model": "Resolved model",
|
|
64
|
-
"Input tokens": "Input tokens",
|
|
65
|
-
"Output tokens": "Output tokens",
|
|
66
|
-
"Total tokens": "Total tokens",
|
|
67
|
-
"Prompt cache tokens": "Prompt cache tokens",
|
|
68
|
-
"Cost": "Cost",
|
|
69
|
-
"Cost status": "Cost status",
|
|
70
|
-
"Request ID": "Request ID",
|
|
71
|
-
"Failed to load models": "Failed to load models",
|
|
72
|
-
"Select a model": "Select a model",
|
|
73
|
-
"Select an AI Employee": "Select an AI Employee",
|
|
74
|
-
"Usage guide": "Usage guide",
|
|
75
|
-
"OpenAI-compatible endpoint": "OpenAI-compatible endpoint",
|
|
76
|
-
"Base URL": "Base URL",
|
|
77
|
-
"Use a NocoBase API key as the Bearer token.": "Use a NocoBase API key as the Bearer token.",
|
|
78
|
-
"List available models": "List available models",
|
|
79
|
-
"Send a chat completion": "Send a chat completion",
|
|
80
|
-
"Usage filters": "Usage filters",
|
|
81
|
-
"Time range": "Time range",
|
|
82
|
-
"User ID": "User ID",
|
|
83
|
-
"Succeeded": "Succeeded",
|
|
84
|
-
"Failed": "Failed",
|
|
85
|
-
"Started": "Started",
|
|
86
|
-
"Apply filters": "Apply filters",
|
|
87
|
-
"Reset": "Reset",
|
|
88
|
-
"Requests": "Requests",
|
|
89
|
-
"Total cost": "Total cost",
|
|
90
|
-
"Usage records": "Usage records",
|
|
91
|
-
"Model metadata": "Model metadata",
|
|
92
|
-
"Add override": "Add override",
|
|
93
|
-
"Edit override": "Edit override",
|
|
94
|
-
"Delete this override?": "Delete this override?",
|
|
95
|
-
"Context window": "Context window",
|
|
96
|
-
"Max completion tokens": "Max completion tokens",
|
|
97
|
-
"Owned by": "Owned by",
|
|
98
|
-
"Display name": "Display name",
|
|
99
|
-
"Description": "Description",
|
|
100
|
-
"Leave empty to not override": "Leave empty to not override",
|
|
101
|
-
"Total input + output token capacity reported to clients.": "Total input + output token capacity reported to clients.",
|
|
102
|
-
"Maximum output tokens reported to clients.": "Maximum output tokens reported to clients.",
|
|
103
|
-
"Initial system prompt": "Initial system prompt",
|
|
104
|
-
"Prepended as the first system message, before any system prompt sent by the client. If the client sends no system prompt, this becomes the system prompt sent to the provider.": "Prepended as the first system message, before any system prompt sent by the client. If the client sends no system prompt, this becomes the system prompt sent to the provider.",
|
|
105
|
-
"AI API": "AI API",
|
|
106
|
-
"Allow this role to use the AI API": "Allow this role to use the AI API",
|
|
107
|
-
"Allow all AI Employees": "Allow all AI Employees",
|
|
108
|
-
"Select which AI Employees this role may use:": "Select which AI Employees this role may use:",
|
|
109
|
-
"Select allowed AI Employees": "Select allowed AI Employees",
|
|
110
|
-
"Max request body size (MB)": "Max request body size (MB)",
|
|
111
|
-
"Raise this to accept inline base64 images. Base64 adds about 33% to the original file size.": "Raise this to accept inline base64 images. Base64 adds about 33% to the original file size.",
|
|
112
|
-
"Usage groups": "Usage groups",
|
|
113
|
-
"Add group": "Add group",
|
|
114
|
-
"Edit group": "Edit group",
|
|
115
|
-
"Delete this group?": "Delete this group?",
|
|
116
|
-
"Mode": "Mode",
|
|
117
|
-
"Share": "Share",
|
|
118
|
-
"Per user": "Per user",
|
|
119
|
-
"Rate limit per minute": "Rate limit per minute",
|
|
120
|
-
"Members": "Members",
|
|
121
|
-
"Add member": "Add member",
|
|
122
|
-
"Member added": "Member added",
|
|
123
|
-
"Member removed": "Member removed",
|
|
124
|
-
"Remove member?": "Remove member?",
|
|
125
|
-
"Remove": "Remove",
|
|
126
|
-
"Search group by user": "Search group by user",
|
|
127
|
-
"User belongs to": "User belongs to",
|
|
128
|
-
"User not found": "User not found",
|
|
129
|
-
"Default": "Default",
|
|
130
|
-
"Allowed LLM services": "Allowed LLM services",
|
|
131
|
-
"Allow all models": "Allow all models",
|
|
132
|
-
"Allowed models": "Allowed models",
|
|
133
|
-
"Model access": "Model access",
|
|
134
|
-
"All models": "All models",
|
|
135
|
-
"All services": "All services",
|
|
136
|
-
"No models": "No models",
|
|
137
|
-
"Leave empty to allow every service enabled in the general configuration.": "Leave empty to allow every service enabled in the general configuration.",
|
|
138
|
-
"Users who do not belong to any other group automatically use this default group — no need to add members.": "Users who do not belong to any other group automatically use this default group — no need to add members."
|
|
139
|
-
|
|
1
|
+
{
|
|
2
|
+
"AI API Gateway": "AI API Gateway",
|
|
3
|
+
"Configuration": "Configuration",
|
|
4
|
+
"Default AI Employee": "Default AI Employee",
|
|
5
|
+
"Enabled LLM Services": "Enabled LLM Services",
|
|
6
|
+
"Rate Limit": "Rate Limit",
|
|
7
|
+
"Save Configuration": "Save Configuration",
|
|
8
|
+
"Configuration saved": "Configuration saved",
|
|
9
|
+
"Failed to save configuration": "Failed to save configuration",
|
|
10
|
+
"API mode": "API mode",
|
|
11
|
+
"Direct LLM": "Direct LLM",
|
|
12
|
+
"AI Employee agent": "AI Employee agent",
|
|
13
|
+
"Default LLM service": "Default LLM service",
|
|
14
|
+
"Enable user quotas": "Enable user quotas",
|
|
15
|
+
"Default reserved output tokens": "Default reserved output tokens",
|
|
16
|
+
"Refresh": "Refresh",
|
|
17
|
+
"Model pricing": "Model pricing",
|
|
18
|
+
"User quotas": "User quotas",
|
|
19
|
+
"Usage": "Usage",
|
|
20
|
+
"LLM service": "LLM service",
|
|
21
|
+
"Model": "Model",
|
|
22
|
+
"Input price / 1M": "Input price / 1M",
|
|
23
|
+
"Cache input price / 1M": "Cache input price / 1M",
|
|
24
|
+
"Output price / 1M": "Output price / 1M",
|
|
25
|
+
"Fixed request cost": "Fixed request cost",
|
|
26
|
+
"Currency": "Currency",
|
|
27
|
+
"Status": "Status",
|
|
28
|
+
"Enabled": "Enabled",
|
|
29
|
+
"Disabled": "Disabled",
|
|
30
|
+
"Actions": "Actions",
|
|
31
|
+
"Edit": "Edit",
|
|
32
|
+
"Delete": "Delete",
|
|
33
|
+
"Delete this price?": "Delete this price?",
|
|
34
|
+
"Add price": "Add price",
|
|
35
|
+
"Edit price": "Edit price",
|
|
36
|
+
"Effective from": "Effective from",
|
|
37
|
+
"Effective to": "Effective to",
|
|
38
|
+
"Notes": "Notes",
|
|
39
|
+
"Saved successfully": "Saved successfully",
|
|
40
|
+
"Deleted successfully": "Deleted successfully",
|
|
41
|
+
"User": "User",
|
|
42
|
+
"Period": "Period",
|
|
43
|
+
"Request limit": "Request limit",
|
|
44
|
+
"Token limit": "Token limit",
|
|
45
|
+
"Cost limit": "Cost limit",
|
|
46
|
+
"Timezone": "Timezone",
|
|
47
|
+
"Unlimited": "Unlimited",
|
|
48
|
+
"Add quota": "Add quota",
|
|
49
|
+
"Edit quota": "Edit quota",
|
|
50
|
+
"Delete this quota?": "Delete this quota?",
|
|
51
|
+
"Daily": "Daily",
|
|
52
|
+
"Monthly": "Monthly",
|
|
53
|
+
"Reject unpriced models": "Reject unpriced models",
|
|
54
|
+
"Missing usage behavior": "Missing usage behavior",
|
|
55
|
+
"Use reserved estimate": "Use reserved estimate",
|
|
56
|
+
"Allow without token charge": "Allow without token charge",
|
|
57
|
+
"Context overflow behavior": "Context overflow behavior",
|
|
58
|
+
"Reject request": "Reject request",
|
|
59
|
+
"Truncate oldest conversation turns": "Truncate oldest conversation turns",
|
|
60
|
+
"Started at": "Started at",
|
|
61
|
+
"Requested model": "Requested model",
|
|
62
|
+
"Resolved service": "Resolved service",
|
|
63
|
+
"Resolved model": "Resolved model",
|
|
64
|
+
"Input tokens": "Input tokens",
|
|
65
|
+
"Output tokens": "Output tokens",
|
|
66
|
+
"Total tokens": "Total tokens",
|
|
67
|
+
"Prompt cache tokens": "Prompt cache tokens",
|
|
68
|
+
"Cost": "Cost",
|
|
69
|
+
"Cost status": "Cost status",
|
|
70
|
+
"Request ID": "Request ID",
|
|
71
|
+
"Failed to load models": "Failed to load models",
|
|
72
|
+
"Select a model": "Select a model",
|
|
73
|
+
"Select an AI Employee": "Select an AI Employee",
|
|
74
|
+
"Usage guide": "Usage guide",
|
|
75
|
+
"OpenAI-compatible endpoint": "OpenAI-compatible endpoint",
|
|
76
|
+
"Base URL": "Base URL",
|
|
77
|
+
"Use a NocoBase API key as the Bearer token.": "Use a NocoBase API key as the Bearer token.",
|
|
78
|
+
"List available models": "List available models",
|
|
79
|
+
"Send a chat completion": "Send a chat completion",
|
|
80
|
+
"Usage filters": "Usage filters",
|
|
81
|
+
"Time range": "Time range",
|
|
82
|
+
"User ID": "User ID",
|
|
83
|
+
"Succeeded": "Succeeded",
|
|
84
|
+
"Failed": "Failed",
|
|
85
|
+
"Started": "Started",
|
|
86
|
+
"Apply filters": "Apply filters",
|
|
87
|
+
"Reset": "Reset",
|
|
88
|
+
"Requests": "Requests",
|
|
89
|
+
"Total cost": "Total cost",
|
|
90
|
+
"Usage records": "Usage records",
|
|
91
|
+
"Model metadata": "Model metadata",
|
|
92
|
+
"Add override": "Add override",
|
|
93
|
+
"Edit override": "Edit override",
|
|
94
|
+
"Delete this override?": "Delete this override?",
|
|
95
|
+
"Context window": "Context window",
|
|
96
|
+
"Max completion tokens": "Max completion tokens",
|
|
97
|
+
"Owned by": "Owned by",
|
|
98
|
+
"Display name": "Display name",
|
|
99
|
+
"Description": "Description",
|
|
100
|
+
"Leave empty to not override": "Leave empty to not override",
|
|
101
|
+
"Total input + output token capacity reported to clients.": "Total input + output token capacity reported to clients.",
|
|
102
|
+
"Maximum output tokens reported to clients.": "Maximum output tokens reported to clients.",
|
|
103
|
+
"Initial system prompt": "Initial system prompt",
|
|
104
|
+
"Prepended as the first system message, before any system prompt sent by the client. If the client sends no system prompt, this becomes the system prompt sent to the provider.": "Prepended as the first system message, before any system prompt sent by the client. If the client sends no system prompt, this becomes the system prompt sent to the provider.",
|
|
105
|
+
"AI API": "AI API",
|
|
106
|
+
"Allow this role to use the AI API": "Allow this role to use the AI API",
|
|
107
|
+
"Allow all AI Employees": "Allow all AI Employees",
|
|
108
|
+
"Select which AI Employees this role may use:": "Select which AI Employees this role may use:",
|
|
109
|
+
"Select allowed AI Employees": "Select allowed AI Employees",
|
|
110
|
+
"Max request body size (MB)": "Max request body size (MB)",
|
|
111
|
+
"Raise this to accept inline base64 images. Base64 adds about 33% to the original file size.": "Raise this to accept inline base64 images. Base64 adds about 33% to the original file size.",
|
|
112
|
+
"Usage groups": "Usage groups",
|
|
113
|
+
"Add group": "Add group",
|
|
114
|
+
"Edit group": "Edit group",
|
|
115
|
+
"Delete this group?": "Delete this group?",
|
|
116
|
+
"Mode": "Mode",
|
|
117
|
+
"Share": "Share",
|
|
118
|
+
"Per user": "Per user",
|
|
119
|
+
"Rate limit per minute": "Rate limit per minute",
|
|
120
|
+
"Members": "Members",
|
|
121
|
+
"Add member": "Add member",
|
|
122
|
+
"Member added": "Member added",
|
|
123
|
+
"Member removed": "Member removed",
|
|
124
|
+
"Remove member?": "Remove member?",
|
|
125
|
+
"Remove": "Remove",
|
|
126
|
+
"Search group by user": "Search group by user",
|
|
127
|
+
"User belongs to": "User belongs to",
|
|
128
|
+
"User not found": "User not found",
|
|
129
|
+
"Default": "Default",
|
|
130
|
+
"Allowed LLM services": "Allowed LLM services",
|
|
131
|
+
"Allow all models": "Allow all models",
|
|
132
|
+
"Allowed models": "Allowed models",
|
|
133
|
+
"Model access": "Model access",
|
|
134
|
+
"All models": "All models",
|
|
135
|
+
"All services": "All services",
|
|
136
|
+
"No models": "No models",
|
|
137
|
+
"Leave empty to allow every service enabled in the general configuration.": "Leave empty to allow every service enabled in the general configuration.",
|
|
138
|
+
"Users who do not belong to any other group automatically use this default group — no need to add members.": "Users who do not belong to any other group automatically use this default group — no need to add members.",
|
|
139
|
+
"Membership": "Membership",
|
|
140
|
+
"Model routing": "Model routing",
|
|
141
|
+
"Model routing (virtual models)": "Model routing (virtual models)",
|
|
142
|
+
"Alias": "Alias",
|
|
143
|
+
"Fallback model": "Fallback model",
|
|
144
|
+
"A fallback model is required": "A fallback model is required",
|
|
145
|
+
"Used when no capability bucket candidate is usable and the fallback is permitted for the caller.": "Used when no capability bucket candidate is usable and the fallback is permitted for the caller.",
|
|
146
|
+
"Vision models (in order)": "Vision models (in order)",
|
|
147
|
+
"Requests with an image or file block use the first permitted model here.": "Requests with an image or file block use the first permitted model here.",
|
|
148
|
+
"Tool-calling models (in order)": "Tool-calling models (in order)",
|
|
149
|
+
"Requests with tools/tool_choice use the first permitted model here.": "Requests with tools/tool_choice use the first permitted model here.",
|
|
150
|
+
"Reasoning models (in order)": "Reasoning models (in order)",
|
|
151
|
+
"Requests with an explicit reasoning or reasoning_effort parameter use the first permitted model here.": "Requests with an explicit reasoning or reasoning_effort parameter use the first permitted model here.",
|
|
152
|
+
"Cheap models (in order)": "Cheap models (in order)",
|
|
153
|
+
"Optional. When set, cheap-eligible requests use the first permitted model here.": "Optional. When set, cheap-eligible requests use the first permitted model here.",
|
|
154
|
+
"General models (in order)": "General models (in order)",
|
|
155
|
+
"Default bucket when no capability rule matched. Leave empty to derive from all enabled models ordered by Model metadata sortOrder.": "Default bucket when no capability rule matched. Leave empty to derive from all enabled models ordered by Model metadata sortOrder.",
|
|
156
|
+
"Type service/model and press Enter — earlier entries are preferred": "Type service/model and press Enter — earlier entries are preferred",
|
|
157
|
+
"An empty bucket is derived automatically from Model metadata (capability flags + sortOrder).": "An empty bucket is derived automatically from Model metadata (capability flags + sortOrder).",
|
|
158
|
+
"Save": "Save",
|
|
159
|
+
"Supports vision": "Supports vision",
|
|
160
|
+
"Used by virtual-model routing for image/file requests.": "Used by virtual-model routing for image/file requests.",
|
|
161
|
+
"Supports tool calling": "Supports tool calling",
|
|
162
|
+
"Used by virtual-model routing for requests with tools/tool_choice.": "Used by virtual-model routing for requests with tools/tool_choice.",
|
|
163
|
+
"Reasoning tier": "Reasoning tier",
|
|
164
|
+
"cheap | general | reasoning. Used by virtual-model routing buckets.": "cheap | general | reasoning. Used by virtual-model routing buckets.",
|
|
165
|
+
"Cheap": "Cheap",
|
|
166
|
+
"General": "General",
|
|
167
|
+
"Reasoning": "Reasoning",
|
|
168
|
+
"Routing priority": "Routing priority",
|
|
169
|
+
"Ascending — lower is preferred when a bucket is derived from metadata.": "Ascending — lower is preferred when a bucket is derived from metadata.",
|
|
170
|
+
"Select models — the order shown is the routing priority": "Select models — the order shown is the routing priority",
|
|
171
|
+
"Select a fallback model": "Select a fallback model",
|
|
172
|
+
"Name": "Name",
|
|
173
|
+
"Rate limit/min": "Rate limit/min",
|
|
174
|
+
"unavailable": "(unavailable)"
|
|
175
|
+
}
|
package/dist/locale/vi-VN.json
CHANGED
|
@@ -135,5 +135,43 @@
|
|
|
135
135
|
"All services": "Tất cả dịch vụ",
|
|
136
136
|
"No models": "Không model nào",
|
|
137
137
|
"Leave empty to allow every service enabled in the general configuration.": "Để trống để cho phép mọi dịch vụ đang được bật trong cấu hình chung.",
|
|
138
|
-
"Users who do not belong to any other group automatically use this default group — no need to add members.": "Người dùng không thuộc nhóm nào khác sẽ tự động dùng nhóm mặc định này — không cần thêm thành viên."
|
|
139
|
-
|
|
138
|
+
"Users who do not belong to any other group automatically use this default group — no need to add members.": "Người dùng không thuộc nhóm nào khác sẽ tự động dùng nhóm mặc định này — không cần thêm thành viên.",
|
|
139
|
+
"Membership": "Thành viên ngầm định",
|
|
140
|
+
"Model routing": "Định tuyến model",
|
|
141
|
+
"Model routing (virtual models)": "Định tuyến model (model ảo)",
|
|
142
|
+
"Alias": "Bí danh",
|
|
143
|
+
"Fallback model": "Model dự phòng",
|
|
144
|
+
"A fallback model is required": "Bắt buộc phải có model dự phòng",
|
|
145
|
+
"Used when no capability bucket candidate is usable and the fallback is permitted for the caller.": "Dùng khi không có model nào trong bucket năng lực khả dụng và caller được phép dùng fallback.",
|
|
146
|
+
"Vision models (in order)": "Model vision (theo thứ tự)",
|
|
147
|
+
"Requests with an image or file block use the first permitted model here.": "Request có block ảnh/file sẽ dùng model đầu tiên được phép ở đây.",
|
|
148
|
+
"Tool-calling models (in order)": "Model gọi tool (theo thứ tự)",
|
|
149
|
+
"Requests with tools/tool_choice use the first permitted model here.": "Request có tools/tool_choice sẽ dùng model đầu tiên được phép ở đây.",
|
|
150
|
+
"Reasoning models (in order)": "Model suy luận (theo thứ tự)",
|
|
151
|
+
"Requests with an explicit reasoning or reasoning_effort parameter use the first permitted model here.": "Request có tham số reasoning hoặc reasoning_effort tường minh sẽ dùng model đầu tiên được phép ở đây.",
|
|
152
|
+
"Cheap models (in order)": "Model rẻ (theo thứ tự)",
|
|
153
|
+
"Optional. When set, cheap-eligible requests use the first permitted model here.": "Tùy chọn. Nếu đặt, request đơn giản sẽ dùng model đầu tiên được phép ở đây.",
|
|
154
|
+
"General models (in order)": "Model chung (theo thứ tự)",
|
|
155
|
+
"Default bucket when no capability rule matched. Leave empty to derive from all enabled models ordered by Model metadata sortOrder.": "Bucket mặc định khi không rule năng lực nào khớp. Để trống để derive từ tất cả model được bật, xếp theo sortOrder trong Model metadata.",
|
|
156
|
+
"Type service/model and press Enter — earlier entries are preferred": "Nhập service/model rồi Enter — mục trên được ưu tiên",
|
|
157
|
+
"An empty bucket is derived automatically from Model metadata (capability flags + sortOrder).": "Bucket để trống sẽ tự derive từ cờ năng lực + sortOrder trong Model metadata.",
|
|
158
|
+
"Save": "Lưu",
|
|
159
|
+
"Supports vision": "Hỗ trợ hình ảnh",
|
|
160
|
+
"Used by virtual-model routing for image/file requests.": "Dùng để định tuyến model ảo cho request có hình ảnh hoặc tệp.",
|
|
161
|
+
"Supports tool calling": "Hỗ trợ gọi tool",
|
|
162
|
+
"Used by virtual-model routing for requests with tools/tool_choice.": "Dùng để định tuyến model ảo cho request có tools/tool_choice.",
|
|
163
|
+
"Reasoning tier": "Tầng suy luận",
|
|
164
|
+
"cheap | general | reasoning. Used by virtual-model routing buckets.": "cheap | general | reasoning. Dùng cho các bucket định tuyến model ảo.",
|
|
165
|
+
"Cheap": "Chi phí thấp",
|
|
166
|
+
"General": "Chung",
|
|
167
|
+
"Reasoning": "Suy luận",
|
|
168
|
+
"Routing priority": "Ưu tiên định tuyến",
|
|
169
|
+
"Ascending — lower is preferred when a bucket is derived from metadata.": "Tăng dần — giá trị nhỏ hơn được ưu tiên khi bucket được tạo từ metadata.",
|
|
170
|
+
"Select models — the order shown is the routing priority": "Chọn model — thứ tự hiển thị là thứ tự ưu tiên định tuyến",
|
|
171
|
+
"Select a fallback model": "Chọn model dự phòng",
|
|
172
|
+
"Name": "Tên",
|
|
173
|
+
"Rate limit/min": "Giới hạn/phút",
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
"unavailable": "(không khả dụng)"
|
|
177
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -135,5 +135,43 @@
|
|
|
135
135
|
"All services": "所有服务",
|
|
136
136
|
"No models": "未允许任何模型",
|
|
137
137
|
"Leave empty to allow every service enabled in the general configuration.": "留空则允许通用配置中已启用的所有服务。",
|
|
138
|
-
"Users who do not belong to any other group automatically use this default group — no need to add members.": "不属于其他分组的用户会自动使用此默认分组,无需手动添加成员。"
|
|
139
|
-
|
|
138
|
+
"Users who do not belong to any other group automatically use this default group — no need to add members.": "不属于其他分组的用户会自动使用此默认分组,无需手动添加成员。",
|
|
139
|
+
"Membership": "默认成员",
|
|
140
|
+
"Model routing": "模型路由",
|
|
141
|
+
"Model routing (virtual models)": "模型路由(虚拟模型)",
|
|
142
|
+
"Alias": "别名",
|
|
143
|
+
"Fallback model": "兜底模型",
|
|
144
|
+
"A fallback model is required": "必须填写兜底模型",
|
|
145
|
+
"Used when no capability bucket candidate is usable and the fallback is permitted for the caller.": "当能力桶中没有可用模型且调用者有权使用回退模型时使用。",
|
|
146
|
+
"Vision models (in order)": "视觉模型(按顺序)",
|
|
147
|
+
"Requests with an image or file block use the first permitted model here.": "包含图片或文件块的请求会使用此处第一个有权限的模型。",
|
|
148
|
+
"Tool-calling models (in order)": "工具调用模型(按顺序)",
|
|
149
|
+
"Requests with tools/tool_choice use the first permitted model here.": "包含 tools/tool_choice 的请求会使用此处第一个有权限的模型。",
|
|
150
|
+
"Reasoning models (in order)": "推理模型(按顺序)",
|
|
151
|
+
"Requests with an explicit reasoning or reasoning_effort parameter use the first permitted model here.": "显式包含 reasoning 或 reasoning_effort 参数的请求会使用此处第一个有权限的模型。",
|
|
152
|
+
"Cheap models (in order)": "低成本模型(按顺序)",
|
|
153
|
+
"Optional. When set, cheap-eligible requests use the first permitted model here.": "可选。设置后,低复杂度请求会使用此处第一个有权限的模型。",
|
|
154
|
+
"General models (in order)": "通用模型(按顺序)",
|
|
155
|
+
"Default bucket when no capability rule matched. Leave empty to derive from all enabled models ordered by Model metadata sortOrder.": "没有任何能力规则命中时的默认桶。留空则按模型元数据 sortOrder 对所有已启用模型排序后派生。",
|
|
156
|
+
"Type service/model and press Enter — earlier entries are preferred": "输入 service/模型 后回车——越靠前优先级越高",
|
|
157
|
+
"An empty bucket is derived automatically from Model metadata (capability flags + sortOrder).": "留空的桶会自动从“模型元数据”页的能力标志 + sortOrder 派生。",
|
|
158
|
+
"Save": "保存",
|
|
159
|
+
"Supports vision": "支持视觉输入",
|
|
160
|
+
"Used by virtual-model routing for image/file requests.": "用于对包含图片或文件的请求进行虚拟模型路由。",
|
|
161
|
+
"Supports tool calling": "支持工具调用",
|
|
162
|
+
"Used by virtual-model routing for requests with tools/tool_choice.": "用于对包含 tools/tool_choice 的请求进行虚拟模型路由。",
|
|
163
|
+
"Reasoning tier": "推理层级",
|
|
164
|
+
"cheap | general | reasoning. Used by virtual-model routing buckets.": "cheap | general | reasoning。用于虚拟模型路由桶。",
|
|
165
|
+
"Cheap": "低成本",
|
|
166
|
+
"General": "通用",
|
|
167
|
+
"Reasoning": "推理",
|
|
168
|
+
"Routing priority": "路由优先级",
|
|
169
|
+
"Ascending — lower is preferred when a bucket is derived from metadata.": "升序 — 从元数据派生路由桶时,数值越小优先级越高。",
|
|
170
|
+
"Select models — the order shown is the routing priority": "选择模型 — 显示顺序即路由优先级",
|
|
171
|
+
"Select a fallback model": "选择兜底模型",
|
|
172
|
+
"Name": "名称",
|
|
173
|
+
"Rate limit/min": "每分钟限制",
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
"unavailable": "(不可用)"
|
|
177
|
+
}
|
|
@@ -72,6 +72,32 @@ var ai_api_model_metadata_default = (0, import_database.defineCollection)({
|
|
|
72
72
|
allowNull: true,
|
|
73
73
|
comment: "Initial system prompt prepended as the first system message of every request for this model. Never replaces the client system prompt."
|
|
74
74
|
},
|
|
75
|
+
{
|
|
76
|
+
name: "supportsVision",
|
|
77
|
+
type: "boolean",
|
|
78
|
+
defaultValue: false,
|
|
79
|
+
index: true,
|
|
80
|
+
comment: "Whether the model accepts image content blocks. Used by virtual-model routing."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: "supportsToolCalling",
|
|
84
|
+
type: "boolean",
|
|
85
|
+
defaultValue: true,
|
|
86
|
+
index: true,
|
|
87
|
+
comment: "Whether the model accepts tools / tool_choice. Used by virtual-model routing."
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "reasoningTier",
|
|
91
|
+
type: "string",
|
|
92
|
+
defaultValue: "general",
|
|
93
|
+
comment: "Cost/capability tier for routing: cheap | general | reasoning."
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "sortOrder",
|
|
97
|
+
type: "integer",
|
|
98
|
+
defaultValue: 0,
|
|
99
|
+
comment: "Ascending priority used when deriving a routing bucket from metadata (lower = preferred)."
|
|
100
|
+
},
|
|
75
101
|
{
|
|
76
102
|
name: "enabled",
|
|
77
103
|
type: "boolean",
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var ai_api_response_records_exports = {};
|
|
28
|
+
__export(ai_api_response_records_exports, {
|
|
29
|
+
default: () => ai_api_response_records_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(ai_api_response_records_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var ai_api_response_records_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "aiApiResponseRecords",
|
|
35
|
+
dataCategory: "runtime",
|
|
36
|
+
hidden: true,
|
|
37
|
+
autoGenId: true,
|
|
38
|
+
fields: [
|
|
39
|
+
{
|
|
40
|
+
name: "responseId",
|
|
41
|
+
type: "string",
|
|
42
|
+
unique: true,
|
|
43
|
+
index: true,
|
|
44
|
+
comment: "Public response ID (resp_xxx) exposed to clients"
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: "userId",
|
|
48
|
+
type: "bigInt",
|
|
49
|
+
allowNull: false,
|
|
50
|
+
index: true,
|
|
51
|
+
comment: "Owner of this response chain"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: "user",
|
|
55
|
+
type: "belongsTo",
|
|
56
|
+
target: "users",
|
|
57
|
+
targetKey: "id",
|
|
58
|
+
foreignKey: "userId",
|
|
59
|
+
constraints: false
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
name: "model",
|
|
63
|
+
type: "string",
|
|
64
|
+
allowNull: false,
|
|
65
|
+
index: true,
|
|
66
|
+
comment: "Model used for this response (service/model format)"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "input",
|
|
70
|
+
type: "jsonb",
|
|
71
|
+
allowNull: false,
|
|
72
|
+
comment: "Original Responses API input (string or array)"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
name: "output",
|
|
76
|
+
type: "jsonb",
|
|
77
|
+
allowNull: false,
|
|
78
|
+
comment: "Complete ResponseObject as returned to the client"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "previousResponseId",
|
|
82
|
+
type: "string",
|
|
83
|
+
allowNull: true,
|
|
84
|
+
index: true,
|
|
85
|
+
comment: "Links to the previous response in this conversation chain"
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "metadata",
|
|
89
|
+
type: "jsonb",
|
|
90
|
+
allowNull: true,
|
|
91
|
+
comment: "Client-provided metadata from the request"
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
name: "expiresAt",
|
|
95
|
+
type: "datetimeTz",
|
|
96
|
+
allowNull: false,
|
|
97
|
+
index: true,
|
|
98
|
+
comment: "Auto-delete after 30 days (OpenAI retention policy)"
|
|
99
|
+
}
|
|
100
|
+
]
|
|
101
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
12
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
13
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
14
|
+
var __export = (target, all) => {
|
|
15
|
+
for (var name in all)
|
|
16
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
17
|
+
};
|
|
18
|
+
var __copyProps = (to, from, except, desc) => {
|
|
19
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
20
|
+
for (let key of __getOwnPropNames(from))
|
|
21
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
22
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
23
|
+
}
|
|
24
|
+
return to;
|
|
25
|
+
};
|
|
26
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
27
|
+
var ai_api_virtual_models_exports = {};
|
|
28
|
+
__export(ai_api_virtual_models_exports, {
|
|
29
|
+
default: () => ai_api_virtual_models_default
|
|
30
|
+
});
|
|
31
|
+
module.exports = __toCommonJS(ai_api_virtual_models_exports);
|
|
32
|
+
var import_database = require("@nocobase/database");
|
|
33
|
+
var ai_api_virtual_models_default = (0, import_database.defineCollection)({
|
|
34
|
+
name: "aiApiVirtualModels",
|
|
35
|
+
autoGenId: true,
|
|
36
|
+
fields: [
|
|
37
|
+
{
|
|
38
|
+
name: "name",
|
|
39
|
+
type: "string",
|
|
40
|
+
unique: true,
|
|
41
|
+
allowNull: false,
|
|
42
|
+
comment: 'Alias the client passes as the model id, e.g. "auto".'
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "mode",
|
|
46
|
+
type: "string",
|
|
47
|
+
defaultValue: "chat",
|
|
48
|
+
comment: "Endpoint family this alias serves: chat | embedding."
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: "fallbackModel",
|
|
52
|
+
type: "string",
|
|
53
|
+
allowNull: false,
|
|
54
|
+
comment: 'Concrete "service/modelId" used when no capability bucket candidate is usable and fallback is permitted.'
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "visionModels",
|
|
58
|
+
type: "json",
|
|
59
|
+
defaultValue: [],
|
|
60
|
+
comment: 'Ordered "service/modelId" list for vision requests.'
|
|
61
|
+
},
|
|
62
|
+
{ name: "toolModels", type: "json", defaultValue: [], comment: "Ordered list for tool-calling requests." },
|
|
63
|
+
{ name: "reasoningModels", type: "json", defaultValue: [], comment: "Ordered list for reasoning-tier requests." },
|
|
64
|
+
{ name: "cheapModels", type: "json", defaultValue: [], comment: "Ordered list for cheap-tier requests." },
|
|
65
|
+
{ name: "generalModels", type: "json", defaultValue: [], comment: "Ordered list for general requests." },
|
|
66
|
+
{ name: "enabled", type: "boolean", defaultValue: true, index: true }
|
|
67
|
+
]
|
|
68
|
+
});
|