MCPcopy Create free account

hub / github.com/QuantumNous/new-api / functions

Functions15,409 in github.com/QuantumNous/new-api

FunctionTestIsClickHouseDSN
(t *testing.T)
model/clickhouse_log_test.go:14
FunctionTestIsOpenAIGPT5Model
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:217
FunctionTestIsQwenThinkingBudgetModel
(t *testing.T)
relaykit/dto/openai_request_zero_value_test.go:99
FunctionTestIsResponsesEventStreamContentType
(t *testing.T)
relay/chat_completions_via_responses_test.go:78
FunctionTestJSONBodyAsTheGatewayParsesIt
(t *testing.T)
relay/requestplugin/requestplugin_test.go:1890
FunctionTestJSONColumnDatabaseRoundTrip
(t *testing.T)
model/json_column_test.go:104
FunctionTestJSONColumnScannersAcceptStringAndBytes
保护契约:json 列的 Scan 必须同时接受 []byte 与 string——不同驱动/协议 模式返回类型不同,静默丢弃 string 会把已有数据清零。
model/json_column_test.go:78
FunctionTestJSONColumnValuersReturnString
保护契约:PostgreSQL 走 simple protocol(PrepareStmt 关闭)时,driver.Valuer 返回 []byte 会被 pgx 按 bytea 十六进制字面量编码,写入 json 列触发 SQLSTATE 22P02。所有 json 列的 Value() 必须返回
model/json_column_test.go:22
FunctionTestJSONColumnValuersZeroValueIsNil
空值仍返回 nil,保持列的 NULL 语义。
model/json_column_test.go:62
FunctionTestJSONHelpersRouteThroughInjectedCodec
(t *testing.T)
relaykit/relayconvert/kitutil/json_test.go:39
FunctionTestJSONModelRoutingUsesReadersForDiskBodies
(t *testing.T)
middleware/distributor_test.go:33
FunctionTestJSONPatchNeedsJSONBody
(t *testing.T)
pkg/requestpatch/patch_test.go:215
FunctionTestJSONStateChangesAndEncodedLimits
(t *testing.T)
pkg/jsplugin/engine_test.go:368
FunctionTestJSONStateUTF8Normalization
(t *testing.T)
pkg/jsplugin/engine_test.go:463
FunctionTestJimengBearerAPIDecoders
Jimeng's Bearer API takes the bodies of the signed actions: submit_task_v2 creates a task, get_result_v2 reads one by req_key and task_id.
plugins/jimeng_responses_test.go:97
FunctionTestJimengNativeBodiesAndReplies
The Bearer API sends Jimeng's own body as is and answers with Jimeng's own replies: no shorthands, no gateway fields, Jimeng's statuses.
plugins/jimeng_responses_test.go:131
FunctionTestJimengParseTaskResultUnknownStatus
(t *testing.T)
plugins/jimeng_responses_test.go:79
FunctionTestJimengResponsesProtocol
(t *testing.T)
plugins/jimeng_responses_test.go:13
FunctionTestJimengSubmitStateDrivesQueryReqKey
(t *testing.T)
plugins/jimeng_responses_test.go:46
FunctionTestJsonRawMessageToString
(t *testing.T)
common/json_test.go:18
FunctionTestKeywordsField
A keywords field reads as its count and longest length in hooks and in validateConfig; utils.keywords matches it in Go, in either letter case.
pkg/jsplugin/keywords_test.go:42
FunctionTestKeywordsSearchStopsAtTheLimit
A search stops once it has found the limit of keywords: the text after them is not searched, however often the keywords repeat in it. A keyword across
pkg/jsplugin/keywords_test.go:129
FunctionTestKeywordsTenThousandOnALargePrompt
10,000 keywords and a 20 KiB prompt: the matcher is built once, on the first match, and every later call reuses the parsed list by address; a reloaded
pkg/jsplugin/keywords_test.go:71
FunctionTestKeywordsUnusedBuildNothing
A hook that never matches costs no matcher, and a plugin without a keywords field reads its config as it is.
pkg/jsplugin/keywords_test.go:147
FunctionTestKling4
(t *testing.T)
plugins/kling_responses_test.go:245
FunctionTestKlingNativeRouteSubmitPollSettleAndQuery
(t *testing.T)
controller/plugin_native_e2e_test.go:89
FunctionTestKlingResponsesProtocol
(t *testing.T)
plugins/kling_responses_test.go:20
FunctionTestLanguageFromUserSetting
The web console saves its own language codes (zhCN, zhTW, fr, ...) in the user setting; backend messages must follow them, and languages without a bac
i18n/i18n_test.go:26
FunctionTestLegacyAccessTokenRetireAtIsWrittenOnceAndReadOnly
(t *testing.T)
model/user_update_test.go:433
FunctionTestLegacyConsoleListMigrationCapsAPIInfoAndFAQ
(t *testing.T)
model/frontend_option_migration_test.go:75
FunctionTestLegacyDalleValidationAndPricesRemainCompatible
(t *testing.T)
relay/helper/openai_image_request_test.go:24
FunctionTestLegacyLogOtherVisibilityIsRoleSeparated
(t *testing.T)
model/log_format_test.go:88
FunctionTestLegacyRejectReasonDoesNotOverrideScopedValue
(t *testing.T)
model/log_format_test.go:170
FunctionTestLegacyRejectReasonHandlesNullAdminInfo
(t *testing.T)
model/log_format_test.go:189
FunctionTestLegacyScopedPoliciesDoNotExpandPermissions
(t *testing.T)
service/authz/authz_test.go:80
FunctionTestLegacyVideoArtifactContentUsesGetResultURL
(t *testing.T)
controller/task_generic_test.go:317
FunctionTestLen_BoundaryExact
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:1100
FunctionTestLen_BoundaryPlusOne
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:1111
FunctionTestLen_LongContextTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:1084
FunctionTestLen_StandardTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:1069
FunctionTestLen_ZeroDefaultsToZero
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:1122
FunctionTestListActiveUserSessionsKeepsCurrentAndBoundsOtherSessions
(t *testing.T)
model/user_session_test.go:427
FunctionTestListModelsIncludesTieredBillingModel
(t *testing.T)
controller/model_list_test.go:268
FunctionTestListModelsSupportsOpenAIAndGeminiAuthentication
(t *testing.T)
router/relay_router_test.go:21
FunctionTestListModelsTokenLimitIncludesTieredBillingModel
(t *testing.T)
controller/model_list_test.go:395
FunctionTestListModelsTokenLimitUsesResolvedCustomAutoGroups
(t *testing.T)
controller/model_list_test.go:434
FunctionTestListModelsUsesAdvancedCustomEndpointTypesFromPricingCache
(t *testing.T)
controller/model_list_test.go:324
FunctionTestListTaskPluginsIncludesFactoryWithoutDatabaseRows
(t *testing.T)
controller/task_plugin_test.go:406
FunctionTestLoadTaskArtifactAccessLimitsFallsBackForInvalidValues
(t *testing.T)
setting/system_setting/task_artifact_test.go:22
FunctionTestLoadTaskArtifactAccessLimitsUsesPositiveEnvironmentValues
(t *testing.T)
setting/system_setting/task_artifact_test.go:9
FunctionTestLoadTaskArtifactStoreConfigFallsBackToUpstream
(t *testing.T)
setting/system_setting/task_artifact_store_test.go:57
FunctionTestLoadToolPricesFromJSONStringReplacesMapAndKeepsValidSiblings
(t *testing.T)
setting/operation_setting/tools_price_test.go:140
FunctionTestLocalesRenderEveryKey
A key missing from a locale, or a template that does not parse, reaches clients as the raw key.
i18n/i18n_test.go:118
FunctionTestLocalizedTextContract
(t *testing.T)
pkg/jsplugin/registry_test.go:643
FunctionTestLocalizedTextFallbackIsDeterministic
(t *testing.T)
pkg/jsplugin/provider_test.go:1223
FunctionTestLockForUpdateEmitsRowLock
lockForUpdate must emit FOR UPDATE on databases that support it and skip it on SQLite, where the syntax does not exist. The dummy dialector is used b
model/locking_test.go:18
FunctionTestLogExportDatabaseMatrix
(t *testing.T)
controller/log_export_test.go:84
FunctionTestLogExportRules
(t *testing.T)
controller/log_export_test.go:153
FunctionTestLogFormattingPreservesLargeIntegerLexemes
(t *testing.T)
model/log_format_test.go:202
FunctionTestLogOtherJSONStringDoesNotMutateReceiver
(t *testing.T)
model/log_other_test.go:72
FunctionTestLogOtherRejectsSensitivePublicFields
(t *testing.T)
model/log_other_test.go:48
FunctionTestLogOtherScopesAndMerges
(t *testing.T)
model/log_other_test.go:10
FunctionTestLogQuotaDataSplitsRowsByUseGroupTokenChannelAndNode
(t *testing.T)
model/usedata_flow_test.go:135
FunctionTestLogTaskConsumptionIncludesTieredSnapshotUsageFacts
(t *testing.T)
service/task_billing_test.go:305
FunctionTestLogTaskConsumptionMarksInlineResultsAndDiscardedArtifacts
Task logs distinguish jobs the client polls from requests whose HTTP call returned the deliverable itself, and flag results the gateway did not keep.
service/task_billing_test.go:397
FunctionTestLogTaskConsumptionWithoutSnapshotKeepsRatioMode
(t *testing.T)
service/task_billing_test.go:353
FunctionTestLoginContextAndInput
(t *testing.T)
pkg/jsplugin/provider_test.go:274
FunctionTestLoginSessionCreateRefreshAndRevoke
(t *testing.T)
service/auth_session_test.go:340
FunctionTestLoginStepsDecode
(t *testing.T)
pkg/jsplugin/provider_test.go:290
FunctionTestLoginStepsRejected
(t *testing.T)
pkg/jsplugin/provider_test.go:323
FunctionTestLookupBuiltinResponseConverters
(t *testing.T)
relaykit/relayconvert/response_registry_test.go:14
FunctionTestLookupBuiltinTextConverters
(t *testing.T)
relaykit/relayconvert/text_converter_registry_test.go:11
FunctionTestLookupHostProtocolOperationExcludesRetrieveWithoutModelField
(t *testing.T)
pkg/jsplugin/routing_test.go:93
FunctionTestMain
(m *testing.M)
service/task_billing_test.go:30
FunctionTestMain
(m *testing.M)
model/task_cas_test.go:19
FunctionTestMain
TestMain installs a deterministic media resolver so image-bearing fixtures convert without network access.
relaykit/relayconvert/golden_test.go:29
FunctionTestManageUserDeleteReturnsImmediatelyAndUnknownActionFails
(t *testing.T)
controller/user_manage_test.go:204
FunctionTestManageUserDemoteAdvancesAuthVersionAndRevokesSessionsOnce
(t *testing.T)
controller/user_manage_test.go:157
FunctionTestManageUserDisableAdvancesAuthVersionOnceAndRevokesSession
(t *testing.T)
controller/user_manage_test.go:129
FunctionTestManageUserQuotaCacheUsesCommittedIntegerDifference
(t *testing.T)
controller/user_manage_test.go:576
FunctionTestManageUserQuotaConcurrentSnapshots
(t *testing.T)
controller/user_manage_test.go:524
FunctionTestManageUserQuotaFailuresDoNotRecordTopup
(t *testing.T)
controller/user_manage_test.go:318
FunctionTestManageUserQuotaLogFailureKeepsSuccessfulAdjustment
(t *testing.T)
controller/user_manage_test.go:371
FunctionTestManageUserQuotaMiddlewareKeepsOneOperationPerRequest
(t *testing.T)
controller/user_manage_test.go:468
FunctionTestManageUserQuotaRecordsTopupAndAudit
(t *testing.T)
controller/user_manage_test.go:241
FunctionTestManageUserQuotaTargetsAndWalletBounds
(t *testing.T)
controller/user_manage_test.go:401
FunctionTestMantleCanceledRequestSkipsRetry
(t *testing.T)
relay/channel/aws/relay_aws_test.go:998
FunctionTestMantleDoesNotFollowRedirectsOrFallbackOnAuthFailure
(t *testing.T)
relay/channel/aws/relay_aws_test.go:759
FunctionTestMantleEndpointAndCredentialValidation
(t *testing.T)
relay/channel/aws/relay_aws_test.go:663
FunctionTestMantleHTTPResponsesPreserveCacheUsage
(t *testing.T)
relay/channel/aws/relay_aws_test.go:696
FunctionTestMantleRejectsInvalidRequestsAndPreservesExplicitModelIDs
(t *testing.T)
relay/channel/aws/relay_aws_test.go:821
FunctionTestMantleRequestPreservesNativeFieldsAndSignsFinalPayload
(t *testing.T)
relay/channel/aws/relay_aws_test.go:601
FunctionTestMantleSignatureMatchesWireHeaders
(t *testing.T)
relay/channel/aws/relay_aws_test.go:860
FunctionTestMaskSensitiveInfoMasksOnlyTheUpstreamAddress
(t *testing.T)
relaykit/relayconvert/kitutil/mask_test.go:9
FunctionTestMasterFinishesSyncTasksEveryOnlineNodeApplied
The master marks a topic's sync tasks done once every online node that keeps the topic has applied them. The newest waiting task shows how many have,
service/node_sync_test.go:219
FunctionTestMasterSwitchEmptiesOptionsAndKeepsList
(t *testing.T)
controller/task_plugin_test.go:433
FunctionTestMasterSwitchKeepsRequestProcessingPlugins
The master switch covers task and provider plugin channels only: with it off, a plugin's request processing part is still offered and its instances ar
controller/task_plugin_test.go:451
FunctionTestMasterSwitchOffKeepsRequestProcessing
The plugin master switch covers task and provider plugin channels only: with it off, an enabled instance still processes relay requests.
relay/requestplugin/requestplugin_test.go:1960
FunctionTestMathHelpers
--------------------------------------------------------------------------- Math helper functions ----------------------------------------------------
pkg/billingexpr/billingexpr_test.go:226
FunctionTestMaxTokensBounds
TestMaxTokensBounds guards the billing invariant that user-supplied max token fields are bounded on every relay format. These values feed pre-consume
relay/helper/max_tokens_bounds_test.go:19
← previousnext →12,701–12,800 of 15,409, ranked by callers