@common_ch/common 1.0.282 → 1.0.284
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/build/events/portal/ai-option/{ai-created-event.d.ts → ai-option-created-event.d.ts} +2 -2
- package/build/events/portal/ai-option/{ai-updated-event.d.ts → ai-option-updated-event.d.ts} +2 -2
- package/build/index.d.ts +2 -2
- package/build/index.js +2 -2
- package/build/services/pricing/caculateCost.d.ts +1 -1
- package/build/services/pricing/caculateCost.js +4 -3
- package/build/services/pricing/pricingTable.d.ts +1 -0
- package/build/services/pricing/pricingTable.js +10 -9
- package/package.json +1 -1
- /package/build/events/portal/ai-option/{ai-created-event.js → ai-option-created-event.js} +0 -0
- /package/build/events/portal/ai-option/{ai-updated-event.js → ai-option-updated-event.js} +0 -0
package/build/events/portal/ai-option/{ai-created-event.d.ts → ai-option-created-event.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AiOptionFieldEnum } from "../../../enums/ai";
|
|
1
|
+
import { AiOptionFieldEnum, AiOptionNamesEnum } from "../../../enums/ai";
|
|
2
2
|
import { Subjects } from "../../subjects";
|
|
3
3
|
export interface AiOptionCreatedEvent {
|
|
4
4
|
subject: Subjects.AiOptionCreated;
|
|
5
5
|
data: {
|
|
6
6
|
id: string;
|
|
7
|
-
name:
|
|
7
|
+
name: AiOptionNamesEnum;
|
|
8
8
|
field: AiOptionFieldEnum;
|
|
9
9
|
image?: string;
|
|
10
10
|
description?: string;
|
package/build/events/portal/ai-option/{ai-updated-event.d.ts → ai-option-updated-event.d.ts}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { AiOptionFieldEnum } from "../../../enums/ai";
|
|
1
|
+
import { AiOptionFieldEnum, AiOptionNamesEnum } from "../../../enums/ai";
|
|
2
2
|
import { Subjects } from "../../subjects";
|
|
3
3
|
export interface AiOptionUpdatedEvent {
|
|
4
4
|
subject: Subjects.AiOptionUpdated;
|
|
5
5
|
data: {
|
|
6
6
|
id: string;
|
|
7
|
-
name:
|
|
7
|
+
name: AiOptionNamesEnum;
|
|
8
8
|
field: AiOptionFieldEnum;
|
|
9
9
|
image: string;
|
|
10
10
|
description: string;
|
package/build/index.d.ts
CHANGED
|
@@ -28,9 +28,9 @@ export * from './events/portal/ai/ai-changeStatus-event';
|
|
|
28
28
|
export * from './events/portal/ai/ai-update-event';
|
|
29
29
|
export * from './events/portal/ai/ai-set-default-show-event';
|
|
30
30
|
export * from './events/portal/ai/ai-unset-defaultShow-event';
|
|
31
|
-
export * from './events/portal/ai-option/ai-created-event';
|
|
31
|
+
export * from './events/portal/ai-option/ai-option-created-event';
|
|
32
32
|
export * from './events/portal/ai-option/ai-option-changeStatus-event';
|
|
33
|
-
export * from './events/portal/ai-option/ai-updated-event';
|
|
33
|
+
export * from './events/portal/ai-option/ai-option-updated-event';
|
|
34
34
|
export * from './events/portal/ai-option/ai-option-set-default-show-event';
|
|
35
35
|
export * from './events/portal/ai-option/ai-option-unset-defaultShow-event';
|
|
36
36
|
export * from './events/portal/user/user-updated-event';
|
package/build/index.js
CHANGED
|
@@ -54,9 +54,9 @@ __exportStar(require("./events/portal/ai/ai-changeStatus-event"), exports);
|
|
|
54
54
|
__exportStar(require("./events/portal/ai/ai-update-event"), exports);
|
|
55
55
|
__exportStar(require("./events/portal/ai/ai-set-default-show-event"), exports);
|
|
56
56
|
__exportStar(require("./events/portal/ai/ai-unset-defaultShow-event"), exports);
|
|
57
|
-
__exportStar(require("./events/portal/ai-option/ai-created-event"), exports);
|
|
57
|
+
__exportStar(require("./events/portal/ai-option/ai-option-created-event"), exports);
|
|
58
58
|
__exportStar(require("./events/portal/ai-option/ai-option-changeStatus-event"), exports);
|
|
59
|
-
__exportStar(require("./events/portal/ai-option/ai-updated-event"), exports);
|
|
59
|
+
__exportStar(require("./events/portal/ai-option/ai-option-updated-event"), exports);
|
|
60
60
|
__exportStar(require("./events/portal/ai-option/ai-option-set-default-show-event"), exports);
|
|
61
61
|
__exportStar(require("./events/portal/ai-option/ai-option-unset-defaultShow-event"), exports);
|
|
62
62
|
__exportStar(require("./events/portal/user/user-updated-event"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { AiOptionNamesEnum } from "../../enums/ai";
|
|
2
|
-
export declare function calculateCostChat(model: AiOptionNamesEnum, promptTokens: number, completionTokens: number): number;
|
|
2
|
+
export declare function calculateCostChat(model: AiOptionNamesEnum, promptTokens: number, cacheToken: number, completionTokens: number): number;
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.calculateCostChat = calculateCostChat;
|
|
4
4
|
const pricingTable_1 = require("./pricingTable");
|
|
5
|
-
function calculateCostChat(model, promptTokens, completionTokens) {
|
|
5
|
+
function calculateCostChat(model, promptTokens, cacheToken, completionTokens) {
|
|
6
6
|
const pricing = pricingTable_1.pricingTableChat[model];
|
|
7
7
|
if (!pricing)
|
|
8
8
|
throw new Error(`No pricing found for model: ${model}`);
|
|
9
|
-
const cost = (promptTokens /
|
|
10
|
-
(
|
|
9
|
+
const cost = (promptTokens / 1000000) * pricing.prompt +
|
|
10
|
+
(cacheToken / 1000000) * pricing.cache +
|
|
11
|
+
(completionTokens / 1000000) * pricing.completion;
|
|
11
12
|
return parseFloat(cost.toFixed(6));
|
|
12
13
|
}
|
|
@@ -3,17 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.pricingTableTTS = exports.pricingTableAudio = exports.pricingTableImage = exports.pricingTableChat = void 0;
|
|
4
4
|
exports.pricingTableChat = {
|
|
5
5
|
// --- GPT-5 family ---
|
|
6
|
-
'gpt-5-mini': { prompt: 0.
|
|
7
|
-
'gpt-5-nano': { prompt: 0.05, completion: 0.
|
|
8
|
-
'gpt-5': { prompt:
|
|
6
|
+
'gpt-5-mini': { prompt: 0.25, cache: 0.025, completion: 2.0 },
|
|
7
|
+
'gpt-5-nano': { prompt: 0.05, cache: 0.005, completion: 0.4 },
|
|
8
|
+
'gpt-5': { prompt: 1.25, cache: 0.125, completion: 10.00 },
|
|
9
|
+
'gpt-5-pro': { prompt: 15.00, cache: 0.001, completion: 120.00 },
|
|
9
10
|
// --- GPT-4 family ---
|
|
10
|
-
'gpt-4o': { prompt: 2.5, completion: 10 },
|
|
11
|
-
'gpt-4.1': { prompt:
|
|
12
|
-
'gpt-4.1-mini': { prompt: 0.
|
|
13
|
-
'gpt-4.1-nano': { prompt: 0.05, completion: 0.
|
|
14
|
-
'gpt-4o-mini': { prompt: 0.
|
|
11
|
+
'gpt-4o': { prompt: 2.5, cache: 1.25, completion: 10 },
|
|
12
|
+
'gpt-4.1': { prompt: 3, cache: 0.75, completion: 12 },
|
|
13
|
+
'gpt-4.1-mini': { prompt: 0.80, cache: 0.20, completion: 3.20 },
|
|
14
|
+
'gpt-4.1-nano': { prompt: 0.20, cache: 0.05, completion: 0.80 },
|
|
15
|
+
'gpt-4o-mini': { prompt: 0.15, cache: 0.075, completion: 0.60 },
|
|
15
16
|
// --- GPT-3.5 family ---
|
|
16
|
-
'gpt-3.5-turbo': { prompt: 0.
|
|
17
|
+
'gpt-3.5-turbo': { prompt: 3.00, cache: 0.2, completion: 6.00 },
|
|
17
18
|
};
|
|
18
19
|
exports.pricingTableImage = {
|
|
19
20
|
// --- Images ---
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|