nolo-cli 0.1.30 → 0.1.31
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/agent-runtime/agentRecordConfig.ts +0 -2
- package/agent-runtime/hostAdapter.ts +0 -1
- package/agent-runtime/hostRuntimeCapabilities.ts +7 -0
- package/agent-runtime/hostRuntimeConfig.ts +86 -0
- package/agent-runtime/index.ts +13 -0
- package/agent-runtime/localToolPolicy.ts +13 -6
- package/agent-runtime/localWorkspaceTools.ts +333 -30
- package/agent-runtime/platformChatProvider.ts +4 -1
- package/agent-runtime/runtimeToolPolicy.ts +32 -47
- package/agent-runtime/shellCommandPolicy.ts +117 -0
- package/agent-runtime/toolGate.ts +38 -0
- package/agentRecordCommands.ts +1 -1
- package/agentRecordHelpers.ts +35 -20
- package/agentRunParsing.ts +18 -5
- package/agentRuntimeLocal.ts +10 -0
- package/ai/agent/agentRunDialogLineage.ts +56 -0
- package/ai/agent/agentSlice.ts +45 -10
- package/ai/agent/avatarUtils.ts +1 -1
- package/ai/agent/buildSystemPrompt.ts +1 -2
- package/ai/agent/cliExecutor.ts +330 -19
- package/ai/agent/createAgentSchema.ts +22 -0
- package/ai/agent/hooks/fetchPublicAgents.ts +14 -39
- package/ai/agent/hooks/usePublicAgents.ts +90 -192
- package/ai/agent/publicAgentCatalog.ts +359 -0
- package/ai/agent/publicAgentIdentity.ts +76 -0
- package/ai/agent/server/fetchPublicAgents.ts +21 -46
- package/ai/agent/serverOrigin.ts +7 -0
- package/ai/agent/streamAgentChatTurn.ts +23 -21
- package/ai/agent/streamAgentChatTurnUtils.ts +292 -6
- package/ai/agent/types.ts +2 -0
- package/ai/agent/web/agentDisplayUtils.ts +171 -0
- package/ai/agent/web/useAgentModelAvatarComponent.ts +32 -0
- package/ai/ai.locale.ts +8 -0
- package/ai/chat/sendOpenAICompletionsRequest.native.ts +15 -0
- package/ai/chat/sendOpenAICompletionsRequest.ts +93 -1
- package/ai/chat/sendOpenAIResponseRequest.ts +86 -9
- package/ai/chat/updateTotalUsage.ts +7 -0
- package/ai/llm/deepinfra.ts +30 -15
- package/ai/llm/mistral.ts +3 -4
- package/ai/llm/providers.ts +2 -0
- package/ai/llm/types.ts +15 -0
- package/ai/memory/capture.ts +3 -3
- package/ai/memory/consolidate.ts +2 -2
- package/ai/memory/delete.ts +4 -3
- package/ai/memory/query.ts +3 -3
- package/ai/memory/remember.ts +2 -2
- package/ai/memory/store.ts +3 -3
- package/ai/memory/storeShared.ts +3 -2
- package/ai/policy/commercialMultiplier.ts +16 -0
- package/ai/token/billingAdminAuditEvent.ts +68 -0
- package/ai/token/billingAdminAuditEventWriter.ts +41 -0
- package/ai/token/billingAnomaly.ts +90 -0
- package/ai/token/billingAnomalyLifecycle.ts +54 -0
- package/ai/token/billingAnomalyLifecycleWriter.ts +44 -0
- package/ai/token/billingAnomalyWriter.ts +41 -0
- package/ai/token/calculatePrice.ts +3 -2
- package/ai/token/deepinfraReconciliation.ts +153 -0
- package/ai/token/deepinfraRequestIdQuery.ts +92 -0
- package/ai/token/externalToolCost.ts +54 -41
- package/ai/token/missingUsageEstimate.ts +12 -3
- package/ai/token/normalizeUsage.ts +45 -5
- package/ai/token/openaiReconciliation.ts +188 -0
- package/ai/token/providerBillableEvent.ts +84 -0
- package/ai/token/providerBillableEventWriter.ts +36 -0
- package/ai/token/providerBillingAnomalyDrilldown.ts +308 -0
- package/ai/token/providerBillingDrilldown.ts +361 -0
- package/ai/token/providerBillingHealthReport.ts +366 -0
- package/ai/token/providerCall.ts +144 -0
- package/ai/token/providerCallSweeper.ts +168 -0
- package/ai/token/providerCallWriter.ts +33 -0
- package/ai/token/providerCredential.ts +89 -0
- package/ai/token/providerCredentialAnomaly.ts +154 -0
- package/ai/token/providerCredentialLifecycle.ts +59 -0
- package/ai/token/providerCredentialLifecycleWriter.ts +44 -0
- package/ai/token/providerCredentialRegistry.ts +83 -0
- package/ai/token/providerCredentialRegistryCommand.ts +97 -0
- package/ai/token/providerCredentialRegistryList.ts +124 -0
- package/ai/token/providerCredentialRegistryResolver.ts +150 -0
- package/ai/token/providerCredentialRegistryWriter.ts +41 -0
- package/ai/token/providerCredentialRotationCommand.ts +102 -0
- package/ai/token/providerCredentialRuntime.ts +56 -0
- package/ai/token/providerDispatchIntent.ts +67 -0
- package/ai/token/providerDispatchIntentWriter.ts +36 -0
- package/ai/token/providerGateway.ts +260 -0
- package/ai/token/providerReconciliation.ts +148 -0
- package/ai/token/providerReconciliationLocal.ts +97 -0
- package/ai/token/providerReconciliationRunner.ts +165 -0
- package/ai/token/providerReconciliationWriter.ts +41 -0
- package/ai/token/ratingResult.ts +202 -0
- package/ai/token/ratingResultWriter.ts +33 -0
- package/ai/token/serverDialogProjection.ts +5 -3
- package/ai/token/serverTokenWriter.ts +11 -3
- package/ai/token/types.ts +10 -0
- package/ai/tools/agent/callAgentTool.ts +3 -4
- package/ai/tools/agent/presets/appBuilderPreset.ts +5 -7
- package/ai/tools/agent/runStreamingAgentTool.ts +1 -2
- package/ai/tools/agent/streamParallelAgentsTool.ts +2 -3
- package/ai/tools/readXPostTool.ts +1 -5
- package/app/admin/adminPages.ts +9 -0
- package/app/i18n/i18n.config.ts +5 -0
- package/app/i18n/translations/pricing.locale.ts +397 -0
- package/app/utils/desktopAgentRuntimeStatusClient.ts +5 -4
- package/app/utils/desktopAgentRuntimeTurnClient.ts +4 -1
- package/app/utils/imageUtils.ts +64 -34
- package/auth/adminPermissions.ts +18 -0
- package/auth/authSlice.ts +26 -12
- package/auth/hooks/useFetchUsers.ts +3 -0
- package/auth/routes.ts +46 -0
- package/auth/server/accessActivity.ts +4 -3
- package/auth/server/adminPermissions.ts +43 -0
- package/auth/server/adminUsageReport.ts +375 -0
- package/auth/server/billingAnomalies.ts +235 -0
- package/auth/server/billingUsageReport.ts +41 -2
- package/auth/server/creatorEarningCreditConversion.ts +10 -2
- package/auth/server/deduct.ts +14 -7
- package/auth/server/delete.ts +10 -2
- package/auth/server/disable.ts +4 -3
- package/auth/server/emailAutomation.ts +7 -5
- package/auth/server/emailDbConfig.ts +4 -2
- package/auth/server/emailDelivery.ts +24 -20
- package/auth/server/emailDeliveryGuards.ts +10 -7
- package/auth/server/emailPreferences.ts +6 -4
- package/auth/server/emailReport.ts +6 -4
- package/auth/server/emailRuntimeConfig.ts +3 -3
- package/auth/server/emailScenarioNotifications.ts +9 -8
- package/auth/server/enable.ts +4 -3
- package/auth/server/getRechargeHistory.ts +3 -2
- package/auth/server/getUser.ts +3 -2
- package/auth/server/gptProAccess.ts +44 -0
- package/auth/server/inviteReward.ts +10 -7
- package/auth/server/listusers.ts +6 -4
- package/auth/server/login.ts +2 -2
- package/auth/server/productEntitlements.ts +7 -4
- package/auth/server/productPurchase.ts +10 -2
- package/auth/server/providerBillingDrilldown.ts +47 -0
- package/auth/server/providerBillingHealth.ts +71 -0
- package/auth/server/providerCredentials.ts +136 -0
- package/auth/server/recharge.ts +14 -8
- package/auth/server/revokeSessions.ts +4 -3
- package/auth/server/route.ts +77 -0
- package/auth/server/sendEmail.ts +5 -4
- package/auth/server/signup.ts +10 -3
- package/auth/server/token.ts +53 -55
- package/auth/server/tokenUsageBilling.ts +18 -7
- package/auth/server/usageManagementAccess.ts +43 -0
- package/auth/server/usageReport.ts +59 -0
- package/auth/types.ts +12 -0
- package/auth/utils.ts +24 -22
- package/authCommands.ts +36 -2
- package/buildPublish.ts +3 -1
- package/buildPublishArtifactAssembly.ts +62 -1
- package/buildPublishImportAnalysis.ts +21 -16
- package/chat/dialog/dialogLaunchScope.ts +32 -0
- package/chat/dialog/objectAssistantRegistry.ts +2 -2
- package/chat/dialog/useCreateDialog.ts +1 -1
- package/chat/hooks/useChatInput.ts +41 -10
- package/chat/messages/messageSlice.ts +5 -1
- package/chat/messages/pendingAttachmentParts.ts +28 -2
- package/chat/messages/sendFirstMessage.ts +76 -79
- package/chat/messages/types.ts +9 -0
- package/chat/messages/web/streamingMarkdownModel.ts +41 -0
- package/chat/messages/web/useStreamingReveal.ts +91 -0
- package/chat/web/messageInputAgentUi.ts +94 -6
- package/cliEnvHelpers.ts +8 -0
- package/cliRuntimeDoctorReport.ts +193 -0
- package/client/agentConfigResolver.test.ts +0 -2
- package/client/agentRun.test.ts +171 -10
- package/client/agentRun.ts +44 -637
- package/client/agentRunInput.ts +10 -0
- package/client/agentRunLocalExecutor.ts +179 -0
- package/client/agentRunServerTransport.ts +394 -0
- package/client/agentRunTaskRunRecorder.ts +176 -0
- package/client/localRuntimeAdapter.test.ts +236 -9
- package/client/localRuntimeAdapter.ts +221 -23
- package/client/localToolPolicy.test.ts +28 -4
- package/connector-experimental/daemonLauncher.ts +38 -4
- package/connectorRunArtifact.ts +34 -10
- package/connectorWebSocketTarget.ts +9 -5
- package/core/builtinAgents.ts +155 -11
- package/create/space/contentLabels.ts +1 -1
- package/create/space/contentTypeMeta.ts +3 -2
- package/create/space/sidebarVisibleTypes.ts +27 -0
- package/create/space/space.locale.ts +76 -4
- package/database/actions/agentReadResolution.ts +2 -8
- package/database/actions/read.ts +11 -9
- package/database/actions/readAndWait.ts +10 -5
- package/database/server/agentDelegation.ts +3 -2
- package/database/server/authorityStoreConformance.ts +209 -0
- package/database/server/authorityStoreTypes.ts +31 -0
- package/database/server/coreDataProxy.ts +1 -1
- package/database/server/dataHandlers.ts +13 -5
- package/database/server/db.ts +15 -34
- package/database/server/delete.ts +88 -71
- package/database/server/emailRepository.ts +11 -9
- package/database/server/fileService.ts +2 -1
- package/database/server/legacyServerDb.ts +58 -0
- package/database/server/levelAuthorityStore.ts +75 -0
- package/database/server/memoryAuthorityStore.ts +133 -0
- package/database/server/patch.ts +13 -12
- package/database/server/query.ts +3 -2
- package/database/server/read.ts +33 -30
- package/database/server/resourceAccess.ts +7 -5
- package/database/server/serverStoreFactory.ts +124 -0
- package/database/server/spaceMemberAuthority.ts +3 -2
- package/database/server/storeBatchCompat.ts +37 -0
- package/database/server/testAuthorityStore.ts +76 -0
- package/database/server/write.ts +29 -27
- package/integrations/anthropic/anthropicModels.ts +12 -12
- package/integrations/deepseek/models.ts +67 -67
- package/integrations/google/models.ts +111 -53
- package/integrations/openai/models.ts +22 -22
- package/integrations/xai/models.ts +1 -1
- package/localRuntimeDb.ts +39 -2
- package/machineCommandPrompts.ts +2 -0
- package/machineCommands.ts +193 -63
- package/machineWsRunDispatch.ts +80 -15
- package/machineWsSession.ts +39 -2
- package/noloReadBridgePrompt.ts +16 -0
- package/package.json +99 -6
- package/render/layout/mainLayoutViewMode.ts +25 -0
- package/render/page/server/createPage.ts +3 -1
- package/render/page/server/handleCreatePage.ts +2 -11
- package/runtimeDoctorCommands.ts +15 -66
- package/server/api/methods.ts +34 -12
- package/server/api/tableHandlers.ts +6 -3
- package/server/authenticateToken.ts +47 -2
- package/server/billingLedgerRoutes.ts +15 -0
- package/server/buildManifest.ts +54 -0
- package/server/coreReadiness.ts +34 -25
- package/server/coreRuntime.ts +15 -10
- package/server/handlers/activityStatsHandler.ts +5 -2
- package/server/handlers/agentEmailRegistrationE2EHandler.ts +25 -23
- package/server/handlers/agentRun/agentLookup.ts +1 -7
- package/server/handlers/agentRun/autonomousRuntime.ts +11 -10
- package/server/handlers/agentRun/builtinAgents.ts +12 -88
- package/server/handlers/agentRun/continueDialogContext.ts +15 -3
- package/server/handlers/agentRun/{inheritedDialogPrompt.ts → conversationReference.ts} +3 -3
- package/server/handlers/agentRun/dialogLookup.ts +4 -3
- package/server/handlers/agentRun/index.ts +864 -404
- package/server/handlers/agentRun/localRuntimeBootstrap.ts +17 -1
- package/server/handlers/agentRun/loop.ts +920 -508
- package/server/handlers/agentRun/machineConnector.ts +56 -8
- package/server/handlers/agentRun/machineRunAudit.ts +3 -2
- package/server/handlers/agentRun/modelUsageToolHandlers.ts +13 -10
- package/server/handlers/agentRun/requestContext.ts +12 -8
- package/server/handlers/agentRun/runtimeExecutionContext.ts +15 -3
- package/server/handlers/agentRun/runtimePreparation.ts +26 -24
- package/server/handlers/agentRun/runtimeRouting.ts +25 -40
- package/server/handlers/agentRun/runtimeSystemMessages.ts +65 -0
- package/server/handlers/agentRun/saveDialog.ts +97 -87
- package/server/handlers/agentRun/taskRunToolHandler.ts +9 -7
- package/server/handlers/agentRun/toolExecutor.ts +42 -78
- package/server/handlers/agentRun/types.ts +2 -1
- package/server/handlers/appDeployStatusStore.ts +17 -10
- package/server/handlers/appDomainHandler.ts +21 -15
- package/server/handlers/appLegacyInfraCleanup.ts +5 -2
- package/server/handlers/appSandboxHandler.ts +29 -8
- package/server/handlers/appSpaceAccess.ts +15 -8
- package/server/handlers/chatHandler.ts +22 -2
- package/server/handlers/chatUpstreamRetry.ts +225 -2
- package/server/handlers/connector/connectorConnectionRegistry.ts +55 -7
- package/server/handlers/connector/connectorWebSocket.ts +14 -10
- package/server/handlers/desktopAgentRuntimeAdapter.ts +4 -4
- package/server/handlers/desktopAgentRuntimeHostCapabilities.ts +25 -0
- package/server/handlers/desktopAgentRuntimeReadiness.ts +62 -0
- package/server/handlers/desktopAgentRuntimeStatusHandler.ts +38 -30
- package/server/handlers/desktopAgentRuntimeTurnHandler.ts +7 -3
- package/server/handlers/desktopAgentRuntimeTurnService.ts +39 -45
- package/server/handlers/desktopLlamaRuntimeHandler.ts +85 -51
- package/server/handlers/desktopUpdaterHandler.ts +132 -24
- package/server/handlers/favoriteHandlers.ts +8 -2
- package/server/handlers/getDialogBillingHandler.ts +4 -3
- package/server/handlers/getTransactionsHandler.ts +5 -2
- package/server/handlers/machines/machineBinding.ts +1 -0
- package/server/handlers/machines/machineHandlers.ts +0 -14
- package/server/handlers/machines/machineInstallAssets.ts +4 -2
- package/server/handlers/notificationEmitter.ts +5 -3
- package/server/handlers/notificationsHandler.ts +5 -2
- package/server/handlers/providerCallsRecentHandler.ts +234 -0
- package/server/handlers/providerReconciliationRunHandler.ts +180 -0
- package/server/handlers/providerRequestIdsHandler.ts +105 -0
- package/server/handlers/tableAccess.ts +6 -2
- package/server/handlers/tableToolHandlers.ts +28 -14
- package/server/handlers/userSecretsHandler.ts +17 -6
- package/server/handlers/versionHandler.ts +9 -4
- package/server/handlers/versionStore.ts +18 -10
- package/server/html/ssrPreload.ts +5 -3
- package/server/payments/crypto/cryptoUsdcBasePaymentProvider.ts +11 -8
- package/server/payments/crypto/cryptoUsdcBaseScanner.ts +12 -7
- package/server/payments/crypto/cryptoUsdtTronPaymentProvider.ts +11 -8
- package/server/payments/crypto/cryptoUsdtTronScanner.ts +9 -7
- package/server/payments/waffo/waffoPaymentProvider.ts +12 -9
- package/server/runtimeRole.ts +15 -0
- package/server/scheduler/scheduledTaskRuntime.ts +4 -2
- package/server/scheduler/schedulerService.ts +2 -2
- package/server/taskRunBridgeRoutes.ts +8 -5
- package/share/server/fetchCommunityShares.ts +1 -1
- package/share/server/helpers.ts +19 -17
- package/share/server/importShare.ts +9 -13
- package/share/server/listCommunityShares.ts +4 -4
- package/share/server/purchaseDoc.ts +8 -16
- package/share/server/readCommunityShareCover.ts +3 -2
- package/share/server/readSharedTable.ts +14 -13
- package/share/server/tableReplication.ts +42 -39
- package/spaceAttachCommands.ts +135 -0
- package/spaceInternalCommandEntries.ts +2 -0
- package/ai/agent/runtimeServerBase.ts +0 -37
- package/server/handlers/desktopAgentRuntimeHostFacts.ts +0 -40
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
AuthorityBatchOperation,
|
|
3
|
+
AuthorityStore,
|
|
4
|
+
} from "./authorityStoreTypes";
|
|
5
|
+
|
|
6
|
+
type BatchWriterLike = {
|
|
7
|
+
put(key: string, value: unknown): void;
|
|
8
|
+
del(key: string): void;
|
|
9
|
+
write(): Promise<void>;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type LevelLikeForTests = {
|
|
13
|
+
readonly location?: string;
|
|
14
|
+
readonly status?: string;
|
|
15
|
+
open?(): Promise<void>;
|
|
16
|
+
close?(): Promise<void>;
|
|
17
|
+
get<T = any>(key: string): Promise<T>;
|
|
18
|
+
put(key: string, value: unknown): Promise<void>;
|
|
19
|
+
del(key: string): Promise<void>;
|
|
20
|
+
batch(ops: AuthorityBatchOperation[]): Promise<void>;
|
|
21
|
+
batch(): BatchWriterLike;
|
|
22
|
+
iterator(
|
|
23
|
+
options?: {
|
|
24
|
+
gte?: string;
|
|
25
|
+
lte?: string;
|
|
26
|
+
lt?: string;
|
|
27
|
+
reverse?: boolean;
|
|
28
|
+
}
|
|
29
|
+
): AsyncIterableIterator<[string, unknown]>;
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export function createTestAuthorityStore(levelDb: LevelLikeForTests): AuthorityStore {
|
|
33
|
+
return {
|
|
34
|
+
get location() {
|
|
35
|
+
return levelDb.location;
|
|
36
|
+
},
|
|
37
|
+
get status() {
|
|
38
|
+
return levelDb.status;
|
|
39
|
+
},
|
|
40
|
+
async open() {
|
|
41
|
+
await levelDb.open?.();
|
|
42
|
+
},
|
|
43
|
+
async close() {
|
|
44
|
+
await levelDb.close?.();
|
|
45
|
+
},
|
|
46
|
+
async get<T = any>(key: string) {
|
|
47
|
+
return levelDb.get<T>(key);
|
|
48
|
+
},
|
|
49
|
+
async put(key: string, value: unknown) {
|
|
50
|
+
await levelDb.put(key, value);
|
|
51
|
+
},
|
|
52
|
+
async del(key: string) {
|
|
53
|
+
await levelDb.del(key);
|
|
54
|
+
},
|
|
55
|
+
async batchWrite(ops: AuthorityBatchOperation[]) {
|
|
56
|
+
await levelDb.batch(ops);
|
|
57
|
+
},
|
|
58
|
+
createBatch() {
|
|
59
|
+
const batch = levelDb.batch();
|
|
60
|
+
return {
|
|
61
|
+
put(key: string, value: unknown) {
|
|
62
|
+
batch.put(key, value);
|
|
63
|
+
},
|
|
64
|
+
del(key: string) {
|
|
65
|
+
batch.del(key);
|
|
66
|
+
},
|
|
67
|
+
async write() {
|
|
68
|
+
await batch.write();
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
iterator(options = {}) {
|
|
73
|
+
return levelDb.iterator(options);
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
package/database/server/write.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import { logger } from "../../auth/server/shared";
|
|
4
4
|
import { DataType } from "../../create/types";
|
|
5
|
-
import
|
|
6
|
-
import { handleToken, handleCybot } from "./dataHandlers";
|
|
7
|
-
import { handleTransaction } from "./handleTransaction";
|
|
8
|
-
import { handleToken as handleAuthToken } from "../../auth/server/token";
|
|
5
|
+
import { getServerAuthorityStore } from "./db";
|
|
6
|
+
import { handleToken, handleCybot } from "./dataHandlers";
|
|
7
|
+
import { handleTransaction } from "./handleTransaction";
|
|
8
|
+
import { handleToken as handleAuthToken } from "../../auth/server/token";
|
|
9
9
|
import {
|
|
10
10
|
CYBOT_READONLY_MESSAGE,
|
|
11
11
|
isCybotReadOnlyMutation,
|
|
@@ -18,10 +18,11 @@ import { normalizeRecordIdentityForWrite } from "./recordIdentity";
|
|
|
18
18
|
import {
|
|
19
19
|
bootstrapReplicatedTable,
|
|
20
20
|
findActiveLiveShareByTable,
|
|
21
|
-
patchShareMeta,
|
|
22
|
-
reconcileReplicaTable,
|
|
23
|
-
replicateSharedTableMutation,
|
|
24
|
-
} from "../../share/server/tableReplication";
|
|
21
|
+
patchShareMeta,
|
|
22
|
+
reconcileReplicaTable,
|
|
23
|
+
replicateSharedTableMutation,
|
|
24
|
+
} from "../../share/server/tableReplication";
|
|
25
|
+
import { ensureDbOpen } from "./ensureDbOpen";
|
|
25
26
|
|
|
26
27
|
const getRequestOrigin = (req: any): string => {
|
|
27
28
|
try {
|
|
@@ -137,9 +138,10 @@ const bootstrapLiveShareFromWrite = async (
|
|
|
137
138
|
});
|
|
138
139
|
};
|
|
139
140
|
|
|
140
|
-
export const handleWrite = async (req: any, res: any) => {
|
|
141
|
-
|
|
142
|
-
|
|
141
|
+
export const handleWrite = async (req: any, res: any) => {
|
|
142
|
+
const store = getServerAuthorityStore();
|
|
143
|
+
// 1. 鉴权:从 token 中还原用户
|
|
144
|
+
req.user = await handleAuthToken(req, res);
|
|
143
145
|
|
|
144
146
|
const { user } = req;
|
|
145
147
|
const actionUserId = user?.userId;
|
|
@@ -194,13 +196,13 @@ export const handleWrite = async (req: any, res: any) => {
|
|
|
194
196
|
return res.status(400).json({
|
|
195
197
|
message: "local data is not allowed.",
|
|
196
198
|
});
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// ⭐ 确保 LevelDB 已打开(后面要 get/put)
|
|
200
|
-
await
|
|
201
|
-
|
|
202
|
-
// 校验当前操作用户是否存在
|
|
203
|
-
const userExist = await
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// ⭐ 确保 LevelDB 已打开(后面要 get/put)
|
|
202
|
+
await ensureDbOpen(store);
|
|
203
|
+
|
|
204
|
+
// 校验当前操作用户是否存在
|
|
205
|
+
const userExist = await store.get(`user:${actionUserId}`);
|
|
204
206
|
if (!userExist) {
|
|
205
207
|
logger.warn({
|
|
206
208
|
event: "write_permission_denied",
|
|
@@ -312,15 +314,15 @@ export const handleWrite = async (req: any, res: any) => {
|
|
|
312
314
|
}
|
|
313
315
|
}
|
|
314
316
|
|
|
315
|
-
const batch =
|
|
316
|
-
batch.put(customKey, data);
|
|
317
|
-
for (const ik of indexKeys) {
|
|
318
|
-
batch.put(ik, customKey);
|
|
319
|
-
}
|
|
320
|
-
await batch.write();
|
|
321
|
-
} else {
|
|
322
|
-
await
|
|
323
|
-
}
|
|
317
|
+
const batch = store.createBatch();
|
|
318
|
+
batch.put(customKey, data);
|
|
319
|
+
for (const ik of indexKeys) {
|
|
320
|
+
batch.put(ik, customKey);
|
|
321
|
+
}
|
|
322
|
+
await batch.write();
|
|
323
|
+
} else {
|
|
324
|
+
await store.put(customKey, data);
|
|
325
|
+
}
|
|
324
326
|
|
|
325
327
|
if (
|
|
326
328
|
customKey.startsWith("share-") &&
|
|
@@ -10,10 +10,10 @@ export const anthropicModels: Model[] = [
|
|
|
10
10
|
contextWindow: 200000,
|
|
11
11
|
maxOutputTokens: 8192,
|
|
12
12
|
price: {
|
|
13
|
-
input:
|
|
14
|
-
output:
|
|
15
|
-
cachingWrite:
|
|
16
|
-
cachingRead: 2.
|
|
13
|
+
input: 27.0, // $3/MTok * 9
|
|
14
|
+
output: 135.0, // $15/MTok * 9
|
|
15
|
+
cachingWrite: 33.75, // $3.75/MTok * 9
|
|
16
|
+
cachingRead: 2.7, // $0.30/MTok * 9
|
|
17
17
|
},
|
|
18
18
|
},
|
|
19
19
|
{
|
|
@@ -24,10 +24,10 @@ export const anthropicModels: Model[] = [
|
|
|
24
24
|
contextWindow: 200000,
|
|
25
25
|
maxOutputTokens: 8192,
|
|
26
26
|
price: {
|
|
27
|
-
input:
|
|
28
|
-
output:
|
|
29
|
-
cachingWrite:
|
|
30
|
-
cachingRead: 2.
|
|
27
|
+
input: 27.0, // $3/MTok * 9
|
|
28
|
+
output: 135.0, // $15/MTok * 9
|
|
29
|
+
cachingWrite: 33.75, // $3.75/MTok * 9
|
|
30
|
+
cachingRead: 2.7, // $0.30/MTok * 9
|
|
31
31
|
},
|
|
32
32
|
},
|
|
33
33
|
{
|
|
@@ -38,10 +38,10 @@ export const anthropicModels: Model[] = [
|
|
|
38
38
|
contextWindow: 200000,
|
|
39
39
|
maxOutputTokens: 8192,
|
|
40
40
|
price: {
|
|
41
|
-
input:
|
|
42
|
-
output:
|
|
43
|
-
cachingWrite:
|
|
44
|
-
cachingRead: 0.
|
|
41
|
+
input: 7.2, // $0.80/MTok * 9
|
|
42
|
+
output: 36.0, // $4/MTok * 9
|
|
43
|
+
cachingWrite: 9.0, // $1/MTok * 9
|
|
44
|
+
cachingRead: 0.72, // $0.08/MTok * 9
|
|
45
45
|
},
|
|
46
46
|
},
|
|
47
47
|
];
|
|
@@ -1,67 +1,67 @@
|
|
|
1
|
-
import { Model } from "../../ai/llm/types";
|
|
2
|
-
|
|
3
|
-
export const deepSeekModels: Model[] = [
|
|
4
|
-
{
|
|
5
|
-
name: "deepseek-v4-flash",
|
|
6
|
-
displayName: "DeepSeek V4 Flash",
|
|
7
|
-
hasVision: false,
|
|
8
|
-
contextWindow: 1_000_000,
|
|
9
|
-
maxOutputTokens: 384_000,
|
|
10
|
-
jsonOutput: true,
|
|
11
|
-
fnCall: true,
|
|
12
|
-
supportsTool: true,
|
|
13
|
-
supportsReasoningEffort: true,
|
|
14
|
-
price: {
|
|
15
|
-
input: 0.14 * 8,
|
|
16
|
-
inputCacheHit: 0.0028 * 8,
|
|
17
|
-
output: 0.28 * 8,
|
|
18
|
-
},
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
name: "deepseek-v4-pro",
|
|
22
|
-
displayName: "DeepSeek V4 Pro",
|
|
23
|
-
hasVision: false,
|
|
24
|
-
contextWindow: 1_000_000,
|
|
25
|
-
maxOutputTokens: 384_000,
|
|
26
|
-
jsonOutput: true,
|
|
27
|
-
fnCall: true,
|
|
28
|
-
supportsTool: true,
|
|
29
|
-
supportsReasoningEffort: true,
|
|
30
|
-
price: {
|
|
31
|
-
input: 0.435 * 8,
|
|
32
|
-
inputCacheHit: 0.003625 * 8,
|
|
33
|
-
output: 0.87 * 8,
|
|
34
|
-
},
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: "deepseek-chat",
|
|
38
|
-
displayName: "DeepSeek Chat (V4 Flash alias)",
|
|
39
|
-
hasVision: false,
|
|
40
|
-
contextWindow: 1_000_000,
|
|
41
|
-
maxOutputTokens: 384_000,
|
|
42
|
-
jsonOutput: true,
|
|
43
|
-
fnCall: true,
|
|
44
|
-
supportsTool: true,
|
|
45
|
-
price: {
|
|
46
|
-
input: 0.14 * 8,
|
|
47
|
-
inputCacheHit: 0.0028 * 8,
|
|
48
|
-
output: 0.28 * 8,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
name: "deepseek-reasoner",
|
|
53
|
-
displayName: "DeepSeek Reasoner (V4 Flash alias)",
|
|
54
|
-
hasVision: false,
|
|
55
|
-
contextWindow: 1_000_000,
|
|
56
|
-
maxOutputTokens: 384_000,
|
|
57
|
-
jsonOutput: true,
|
|
58
|
-
fnCall: true,
|
|
59
|
-
supportsTool: true,
|
|
60
|
-
supportsReasoningEffort: true,
|
|
61
|
-
price: {
|
|
62
|
-
input: 0.14 * 8,
|
|
63
|
-
inputCacheHit: 0.0028 * 8,
|
|
64
|
-
output: 0.28 * 8,
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
];
|
|
1
|
+
import { Model } from "../../ai/llm/types";
|
|
2
|
+
|
|
3
|
+
export const deepSeekModels: Model[] = [
|
|
4
|
+
{
|
|
5
|
+
name: "deepseek-v4-flash",
|
|
6
|
+
displayName: "DeepSeek V4 Flash",
|
|
7
|
+
hasVision: false,
|
|
8
|
+
contextWindow: 1_000_000,
|
|
9
|
+
maxOutputTokens: 384_000,
|
|
10
|
+
jsonOutput: true,
|
|
11
|
+
fnCall: true,
|
|
12
|
+
supportsTool: true,
|
|
13
|
+
supportsReasoningEffort: true,
|
|
14
|
+
price: {
|
|
15
|
+
input: 0.14 * 8,
|
|
16
|
+
inputCacheHit: 0.0028 * 8,
|
|
17
|
+
output: 0.28 * 8,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: "deepseek-v4-pro",
|
|
22
|
+
displayName: "DeepSeek V4 Pro",
|
|
23
|
+
hasVision: false,
|
|
24
|
+
contextWindow: 1_000_000,
|
|
25
|
+
maxOutputTokens: 384_000,
|
|
26
|
+
jsonOutput: true,
|
|
27
|
+
fnCall: true,
|
|
28
|
+
supportsTool: true,
|
|
29
|
+
supportsReasoningEffort: true,
|
|
30
|
+
price: {
|
|
31
|
+
input: 0.435 * 8,
|
|
32
|
+
inputCacheHit: 0.003625 * 8,
|
|
33
|
+
output: 0.87 * 8,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: "deepseek-chat",
|
|
38
|
+
displayName: "DeepSeek Chat (V4 Flash alias)",
|
|
39
|
+
hasVision: false,
|
|
40
|
+
contextWindow: 1_000_000,
|
|
41
|
+
maxOutputTokens: 384_000,
|
|
42
|
+
jsonOutput: true,
|
|
43
|
+
fnCall: true,
|
|
44
|
+
supportsTool: true,
|
|
45
|
+
price: {
|
|
46
|
+
input: 0.14 * 8,
|
|
47
|
+
inputCacheHit: 0.0028 * 8,
|
|
48
|
+
output: 0.28 * 8,
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "deepseek-reasoner",
|
|
53
|
+
displayName: "DeepSeek Reasoner (V4 Flash alias)",
|
|
54
|
+
hasVision: false,
|
|
55
|
+
contextWindow: 1_000_000,
|
|
56
|
+
maxOutputTokens: 384_000,
|
|
57
|
+
jsonOutput: true,
|
|
58
|
+
fnCall: true,
|
|
59
|
+
supportsTool: true,
|
|
60
|
+
supportsReasoningEffort: true,
|
|
61
|
+
price: {
|
|
62
|
+
input: 0.14 * 8,
|
|
63
|
+
inputCacheHit: 0.0028 * 8,
|
|
64
|
+
output: 0.28 * 8,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
];
|
|
@@ -25,6 +25,8 @@ const createGoogleImageModel = ({
|
|
|
25
25
|
imageOutputTokenEstimateBySize,
|
|
26
26
|
maxOutputTokens,
|
|
27
27
|
contextWindow,
|
|
28
|
+
imageGenerationWaitTimeSeconds,
|
|
29
|
+
imageGenerationProfiles,
|
|
28
30
|
}: {
|
|
29
31
|
name: string;
|
|
30
32
|
displayName: string;
|
|
@@ -34,6 +36,8 @@ const createGoogleImageModel = ({
|
|
|
34
36
|
imageOutputTokenEstimateBySize: NonNullable<Model["imageOutputTokenEstimateBySize"]>;
|
|
35
37
|
maxOutputTokens: number;
|
|
36
38
|
contextWindow: number;
|
|
39
|
+
imageGenerationWaitTimeSeconds?: Model["imageGenerationWaitTimeSeconds"];
|
|
40
|
+
imageGenerationProfiles?: Model["imageGenerationProfiles"];
|
|
37
41
|
}): Model => ({
|
|
38
42
|
name,
|
|
39
43
|
displayName,
|
|
@@ -54,6 +58,8 @@ const createGoogleImageModel = ({
|
|
|
54
58
|
imageOutputTokenEstimateBySize,
|
|
55
59
|
maxOutputTokens,
|
|
56
60
|
contextWindow,
|
|
61
|
+
imageGenerationWaitTimeSeconds,
|
|
62
|
+
imageGenerationProfiles,
|
|
57
63
|
supportsTool: false,
|
|
58
64
|
});
|
|
59
65
|
|
|
@@ -70,10 +76,10 @@ export const googleModels: Model[] = [
|
|
|
70
76
|
supportsTool: true,
|
|
71
77
|
supportsReasoningEffort: true,
|
|
72
78
|
price: {
|
|
73
|
-
input: 1.25 *
|
|
74
|
-
output: 10 *
|
|
75
|
-
cachingWrite: 0.2 *
|
|
76
|
-
cachingRead: 0.2 *
|
|
79
|
+
input: 1.25 * 7,
|
|
80
|
+
output: 10 * 7,
|
|
81
|
+
cachingWrite: 0.2 * 7,
|
|
82
|
+
cachingRead: 0.2 * 7,
|
|
77
83
|
},
|
|
78
84
|
pricingStrategy: {
|
|
79
85
|
type: "tiered_context",
|
|
@@ -81,10 +87,10 @@ export const googleModels: Model[] = [
|
|
|
81
87
|
{
|
|
82
88
|
minContext: 200001,
|
|
83
89
|
price: {
|
|
84
|
-
input: 2.5 *
|
|
85
|
-
output: 15 *
|
|
86
|
-
cachingWrite: 0.25 *
|
|
87
|
-
cachingRead: 0.25 *
|
|
90
|
+
input: 2.5 * 7,
|
|
91
|
+
output: 15 * 7,
|
|
92
|
+
cachingWrite: 0.25 * 7,
|
|
93
|
+
cachingRead: 0.25 * 7,
|
|
88
94
|
},
|
|
89
95
|
},
|
|
90
96
|
],
|
|
@@ -102,10 +108,10 @@ export const googleModels: Model[] = [
|
|
|
102
108
|
supportsTool: true,
|
|
103
109
|
supportsReasoningEffort: true,
|
|
104
110
|
price: {
|
|
105
|
-
input: 0.3 *
|
|
106
|
-
output: 2.5 *
|
|
107
|
-
cachingWrite: 0.2 *
|
|
108
|
-
cachingRead: 0.2 *
|
|
111
|
+
input: 0.3 * 7,
|
|
112
|
+
output: 2.5 * 7,
|
|
113
|
+
cachingWrite: 0.2 * 7,
|
|
114
|
+
cachingRead: 0.2 * 7,
|
|
109
115
|
},
|
|
110
116
|
},
|
|
111
117
|
{
|
|
@@ -120,10 +126,10 @@ export const googleModels: Model[] = [
|
|
|
120
126
|
maxOutputTokens: 4096,
|
|
121
127
|
supportsTool: true,
|
|
122
128
|
price: {
|
|
123
|
-
input: 0.1 *
|
|
124
|
-
output: 0.4 *
|
|
125
|
-
cachingWrite: 0.2 *
|
|
126
|
-
cachingRead: 0.2 *
|
|
129
|
+
input: 0.1 * 7,
|
|
130
|
+
output: 0.4 * 7,
|
|
131
|
+
cachingWrite: 0.2 * 7,
|
|
132
|
+
cachingRead: 0.2 * 7,
|
|
127
133
|
},
|
|
128
134
|
},
|
|
129
135
|
{
|
|
@@ -139,10 +145,10 @@ export const googleModels: Model[] = [
|
|
|
139
145
|
supportsTool: true,
|
|
140
146
|
supportsReasoningEffort: true,
|
|
141
147
|
price: {
|
|
142
|
-
input: 1.5 *
|
|
143
|
-
output: 9 *
|
|
144
|
-
cachingWrite: 0.15 *
|
|
145
|
-
cachingRead: 0.15 *
|
|
148
|
+
input: 1.5 * 7,
|
|
149
|
+
output: 9 * 7,
|
|
150
|
+
cachingWrite: 0.15 * 7,
|
|
151
|
+
cachingRead: 0.15 * 7,
|
|
146
152
|
},
|
|
147
153
|
serviceTierPriceMultipliers: {
|
|
148
154
|
batch: { inputOutput: 0.5, cache: 0.5 },
|
|
@@ -159,10 +165,10 @@ export const googleModels: Model[] = [
|
|
|
159
165
|
maxOutputTokens: 65500,
|
|
160
166
|
supportsTool: true,
|
|
161
167
|
price: {
|
|
162
|
-
input: 0.25 *
|
|
163
|
-
output: 1.5 *
|
|
164
|
-
cachingWrite: 0.025 *
|
|
165
|
-
cachingRead: 0.025 *
|
|
168
|
+
input: 0.25 * 7,
|
|
169
|
+
output: 1.5 * 7,
|
|
170
|
+
cachingWrite: 0.025 * 7,
|
|
171
|
+
cachingRead: 0.025 * 7,
|
|
166
172
|
},
|
|
167
173
|
serviceTierPriceMultipliers: {
|
|
168
174
|
batch: { inputOutput: 0.5, cache: 0.5 },
|
|
@@ -180,10 +186,10 @@ export const googleModels: Model[] = [
|
|
|
180
186
|
supportsTool: true,
|
|
181
187
|
supportsReasoningEffort: true,
|
|
182
188
|
price: {
|
|
183
|
-
input: 0.5 *
|
|
184
|
-
output: 3 *
|
|
185
|
-
cachingWrite: 0.05 *
|
|
186
|
-
cachingRead: 0.05 *
|
|
189
|
+
input: 0.5 * 7,
|
|
190
|
+
output: 3 * 7,
|
|
191
|
+
cachingWrite: 0.05 * 7,
|
|
192
|
+
cachingRead: 0.05 * 7,
|
|
187
193
|
},
|
|
188
194
|
serviceTierPriceMultipliers: {
|
|
189
195
|
priority: { inputOutput: 1.8, cache: 1.8 },
|
|
@@ -202,10 +208,10 @@ export const googleModels: Model[] = [
|
|
|
202
208
|
supportsTool: true,
|
|
203
209
|
supportsReasoningEffort: true,
|
|
204
210
|
price: {
|
|
205
|
-
input: 2 *
|
|
206
|
-
output: 12 *
|
|
207
|
-
cachingWrite: 0.2 *
|
|
208
|
-
cachingRead: 0.2 *
|
|
211
|
+
input: 2 * 7,
|
|
212
|
+
output: 12 * 7,
|
|
213
|
+
cachingWrite: 0.2 * 7,
|
|
214
|
+
cachingRead: 0.2 * 7,
|
|
209
215
|
},
|
|
210
216
|
pricingStrategy: {
|
|
211
217
|
type: "tiered_context",
|
|
@@ -213,10 +219,10 @@ export const googleModels: Model[] = [
|
|
|
213
219
|
{
|
|
214
220
|
minContext: 200001,
|
|
215
221
|
price: {
|
|
216
|
-
input: 4 *
|
|
217
|
-
output: 18 *
|
|
218
|
-
cachingWrite: 0.4 *
|
|
219
|
-
cachingRead: 0.4 *
|
|
222
|
+
input: 4 * 7,
|
|
223
|
+
output: 18 * 7,
|
|
224
|
+
cachingWrite: 0.4 * 7,
|
|
225
|
+
cachingRead: 0.4 * 7,
|
|
220
226
|
},
|
|
221
227
|
},
|
|
222
228
|
],
|
|
@@ -232,10 +238,10 @@ export const googleModels: Model[] = [
|
|
|
232
238
|
supportsTool: true,
|
|
233
239
|
supportsReasoningEffort: true,
|
|
234
240
|
price: {
|
|
235
|
-
input: 2 *
|
|
236
|
-
output: 12 *
|
|
237
|
-
cachingRead: 0.2 *
|
|
238
|
-
cachingWrite: 0.2 *
|
|
241
|
+
input: 2 * 7,
|
|
242
|
+
output: 12 * 7,
|
|
243
|
+
cachingRead: 0.2 * 7,
|
|
244
|
+
cachingWrite: 0.2 * 7,
|
|
239
245
|
},
|
|
240
246
|
serviceTierPriceMultipliers: {
|
|
241
247
|
priority: { inputOutput: 1.8, cache: 1.8 },
|
|
@@ -246,10 +252,10 @@ export const googleModels: Model[] = [
|
|
|
246
252
|
{
|
|
247
253
|
minContext: 200001,
|
|
248
254
|
price: {
|
|
249
|
-
input: 4 *
|
|
250
|
-
output: 18 *
|
|
251
|
-
cachingRead: 0.4 *
|
|
252
|
-
cachingWrite: 0.4 *
|
|
255
|
+
input: 4 * 7,
|
|
256
|
+
output: 18 * 7,
|
|
257
|
+
cachingRead: 0.4 * 7,
|
|
258
|
+
cachingWrite: 0.4 * 7,
|
|
253
259
|
},
|
|
254
260
|
},
|
|
255
261
|
],
|
|
@@ -258,9 +264,9 @@ export const googleModels: Model[] = [
|
|
|
258
264
|
createGoogleImageModel({
|
|
259
265
|
name: "gemini-3-pro-image-preview",
|
|
260
266
|
displayName: "Nano Banana Pro (Gemini 3 Pro Image Preview)",
|
|
261
|
-
inputPrice: 2 *
|
|
262
|
-
outputPrice: 12 *
|
|
263
|
-
imageTokenPricePerMillion: 120 *
|
|
267
|
+
inputPrice: 2 * 7,
|
|
268
|
+
outputPrice: 12 * 7,
|
|
269
|
+
imageTokenPricePerMillion: 120 * 7,
|
|
264
270
|
imageOutputTokenEstimateBySize: {
|
|
265
271
|
"1K": 1120,
|
|
266
272
|
"2K": 1120,
|
|
@@ -268,13 +274,37 @@ export const googleModels: Model[] = [
|
|
|
268
274
|
},
|
|
269
275
|
maxOutputTokens: 8192,
|
|
270
276
|
contextWindow: 65536,
|
|
277
|
+
imageGenerationWaitTimeSeconds: {
|
|
278
|
+
min: 25,
|
|
279
|
+
max: 60,
|
|
280
|
+
},
|
|
281
|
+
imageGenerationProfiles: [
|
|
282
|
+
{
|
|
283
|
+
key: "speed",
|
|
284
|
+
label: "速度优先",
|
|
285
|
+
imageModel: "gemini-3.1-flash-image-preview",
|
|
286
|
+
waitTimeSeconds: {
|
|
287
|
+
min: 10,
|
|
288
|
+
max: 25,
|
|
289
|
+
},
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
key: "quality",
|
|
293
|
+
label: "质量优先",
|
|
294
|
+
imageModel: "gemini-3-pro-image-preview",
|
|
295
|
+
waitTimeSeconds: {
|
|
296
|
+
min: 25,
|
|
297
|
+
max: 60,
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
],
|
|
271
301
|
}),
|
|
272
302
|
createGoogleImageModel({
|
|
273
303
|
name: "gemini-3.1-flash-image-preview",
|
|
274
304
|
displayName: "Nano Banana 2 (Gemini 3.1 Flash Image Preview)",
|
|
275
|
-
inputPrice: 0.5 *
|
|
276
|
-
outputPrice: 3 *
|
|
277
|
-
imageTokenPricePerMillion: 60 *
|
|
305
|
+
inputPrice: 0.5 * 7,
|
|
306
|
+
outputPrice: 3 * 7,
|
|
307
|
+
imageTokenPricePerMillion: 60 * 7,
|
|
278
308
|
imageOutputTokenEstimateBySize: {
|
|
279
309
|
"1K": 1120,
|
|
280
310
|
"2K": 1680,
|
|
@@ -282,17 +312,45 @@ export const googleModels: Model[] = [
|
|
|
282
312
|
},
|
|
283
313
|
maxOutputTokens: 65536,
|
|
284
314
|
contextWindow: 65536,
|
|
315
|
+
imageGenerationWaitTimeSeconds: {
|
|
316
|
+
min: 10,
|
|
317
|
+
max: 25,
|
|
318
|
+
},
|
|
319
|
+
imageGenerationProfiles: [
|
|
320
|
+
{
|
|
321
|
+
key: "speed",
|
|
322
|
+
label: "速度优先",
|
|
323
|
+
imageModel: "gemini-3.1-flash-image-preview",
|
|
324
|
+
waitTimeSeconds: {
|
|
325
|
+
min: 10,
|
|
326
|
+
max: 25,
|
|
327
|
+
},
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
key: "quality",
|
|
331
|
+
label: "质量优先",
|
|
332
|
+
imageModel: "gemini-3-pro-image-preview",
|
|
333
|
+
waitTimeSeconds: {
|
|
334
|
+
min: 25,
|
|
335
|
+
max: 60,
|
|
336
|
+
},
|
|
337
|
+
},
|
|
338
|
+
],
|
|
285
339
|
}),
|
|
286
340
|
createGoogleImageModel({
|
|
287
341
|
name: "gemini-2.5-flash-image",
|
|
288
342
|
displayName: "Gemini 2.5 Flash Image (Nano Banana)",
|
|
289
|
-
inputPrice: 0.3 *
|
|
290
|
-
outputPrice: 2.5 *
|
|
291
|
-
imageTokenPricePerMillion: 30 *
|
|
343
|
+
inputPrice: 0.3 * 7,
|
|
344
|
+
outputPrice: 2.5 * 7,
|
|
345
|
+
imageTokenPricePerMillion: 30 * 7,
|
|
292
346
|
imageOutputTokenEstimateBySize: {
|
|
293
347
|
"1K": 1290,
|
|
294
348
|
},
|
|
295
349
|
maxOutputTokens: 4096,
|
|
296
350
|
contextWindow: 32768,
|
|
351
|
+
imageGenerationWaitTimeSeconds: {
|
|
352
|
+
min: 8,
|
|
353
|
+
max: 20,
|
|
354
|
+
},
|
|
297
355
|
}),
|
|
298
356
|
];
|