Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
15,409 in github.com/QuantumNous/new-api
⨍
Functions
15,409
◇
Types & classes
2,241
Function
TestChatCompletionsResponseToResponsesMapsIncompleteFinishReasons
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:125
Function
TestChatCompletionsResponseToResponsesPreservesTextToolCallsAndUsage
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:14
Function
TestChatCompletionsResponseToResponsesRestoresCustomToolCalls
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:367
Function
TestChatCompletionsStreamToResponsesEmitsReasoningSummaryPartLifecycle
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:216
Function
TestChatCompletionsStreamToResponsesEventsAggregatesUsageAndToolArgs
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:158
Function
TestChatCompletionsStreamToResponsesHoldsNamelessToolUntilNameArrives
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:464
Function
TestChatCompletionsStreamToResponsesReopensItemsAfterMidStreamFinishReason
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:273
Function
TestChatCompletionsStreamToResponsesRestoresCustomToolCalls
(t *testing.T)
relaykit/relayconvert/internal/oai_chat/to_oai_responses_resp_test.go:408
Function
TestCheckNotificationLimitRedisWindowSpansClockHours
(t *testing.T)
service/notify_limit_test.go:53
Function
TestCheckNotificationLimitWindowSpansClockHours
限流窗口必须由 NOTIFICATION_LIMIT_DURATION_MINUTE 决定,不能在整点被重置
service/notify_limit_test.go:18
Function
TestCheckPDFCrossReferenceStream
A cross-reference stream is decoded as the library decodes it: by the predictor columns of its decode parameters, held to the column bound, and with t
relay/requestplugin/pdf_test.go:276
Function
TestCheckPDFObjectStreams
checkPDF builds the cross-reference table the library builds and holds every object stream the library may read objects from to bounds: /N within its
relay/requestplugin/pdf_test.go:195
Function
TestCheckResponsesWSModelAccessMatchesHTTPTokenLimits
The WebSocket relay must admit the same model names as the HTTP distributor when a token restricts models (reasoning suffixes and @modifiers included)
relay/responses_websocket_test.go:124
Function
TestCheckSubmittedPluginCredentials
(t *testing.T)
service/provider_plugin_test.go:746
Function
TestCheckSystemOverload
(t *testing.T)
common/system_monitor_test.go:222
Function
TestChooseDBRejectsClickHouseForMainDatabase
(t *testing.T)
model/clickhouse_log_test.go:51
Function
TestClassifyRelayOutcome
(t *testing.T)
pkg/perf_metrics/metrics_test.go:20
Function
TestClaudeCacheCreationFlatFieldsStillSettleWhenSnapshotNeverHadSubObject
(t *testing.T)
relaykit/dto/usage_merge_test.go:192
Function
TestClaudeCacheCreationSubObjectZeroDoesNotReviveFlatLegacyFields
(t *testing.T)
relaykit/dto/usage_merge_test.go:167
Function
TestClaudeCacheOnlyUsageRemainsBillable
(t *testing.T)
service/text_quota_test.go:1456
Function
TestClaudeDefaultMaxTokensPresence
(t *testing.T)
relaykit/relayconvert/claude_default_max_tokens_test.go:18
Function
TestClaudeManualThinkingBoundsAreCoerced
(t *testing.T)
relaykit/relayconvert/claude_default_max_tokens_test.go:210
Function
TestClaudeMessagesRequestToOpenAIChatKeepsParallelToolResultsContiguous
(t *testing.T)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_req_test.go:112
Function
TestClaudeMessagesRequestToOpenAIChatToolResultContent
(t *testing.T)
relaykit/relayconvert/internal/claude_messages/to_oai_chat_req_test.go:14
Function
TestClaudeMessagesToOpenAIChatKeepsToolOnlyContentEmpty
(t *testing.T)
relaykit/relayconvert/request_registry_test.go:60
Function
TestClaudeMessagesToOpenAIChatPreservesAssistantTextWithToolCalls
(t *testing.T)
relaykit/relayconvert/request_registry_test.go:18
Function
TestClaudeResponsePassesInputTransformationsThrough
(t *testing.T)
relay/channel/claude/relay_claude_test.go:481
Function
TestClaudeSearchResultBlocksBillVendorSearch
On a channel whose upstream prices search itself (DeepSeek), each delivered web_search_tool_result bills one search under the vendor key, so a stream
relay/channel/claude/tool_billing_test.go:131
Function
TestClaudeSettingsWriteHeadersDeduplicatesAcrossCommaSeparatedAndRepeatedValues
(t *testing.T)
setting/model_setting/claude_test.go:37
Function
TestClaudeSettingsWriteHeadersMergesConfiguredValuesIntoSingleHeader
(t *testing.T)
setting/model_setting/claude_test.go:11
Function
TestClaudeStreamFallbackCountsInterruptedToolUse
A stream cut off during an agent tool call must still estimate the call's output tokens when the final usage never arrives.
relay/channel/claude/relay_claude_test.go:283
Function
TestClaudeStreamFinalUsageEstimatesOnlyUncountedUsage
(t *testing.T)
relay/channel/claude/relay_claude_test.go:27
Function
TestClaudeTargetStatefulStreamTerminalTail
(t *testing.T)
relaykit/relayconvert/terminal_stream_test.go:106
Function
TestClaudeThinkingAdapterSatisfiesMaxTokensWithoutCallback
The thinking adapter's max_tokens floor is an injection path of its own: a "-thinking" request without max_tokens must keep converting even when no De
relaykit/relayconvert/claude_default_max_tokens_test.go:108
Function
TestClaude_BoundaryExact
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:136
Function
TestClaude_LongContextTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:122
Function
TestClaude_StandardTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:108
Function
TestCleanupAuthArtifactsAlertsBeforeDeletingHourlyIssuance
(t *testing.T)
service/auth_session_test.go:213
Function
TestCleanupAuthArtifactsContinuesWithRevokedCleanupAfterExpiredBatchFailure
(t *testing.T)
service/auth_session_test.go:303
Function
TestCleanupAuthArtifactsRemovesOnlyExpiredRecords
(t *testing.T)
service/auth_session_test.go:261
Function
TestClearChannelReadOnlyFields
(t *testing.T)
controller/channel_authz_test.go:99
Function
TestClearCurrentChannelAffinityCache
(t *testing.T)
service/channel_affinity_template_test.go:264
Function
TestClearTelegramBindingReleasesIdentityClaim
(t *testing.T)
model/external_identity_claim_test.go:46
Function
TestClearUserAuthorizationRemovesOverrides
(t *testing.T)
service/authz/authz_test.go:197
Function
TestClickHouseCreateTableHasTTL
(t *testing.T)
model/clickhouse_log_test.go:93
Function
TestClickHouseLogCreateTableSQL
(t *testing.T)
model/clickhouse_log_test.go:80
Function
TestClickHouseLogOrder
(t *testing.T)
model/clickhouse_log_test.go:99
Function
TestClickHouseLogTTLClause
(t *testing.T)
model/clickhouse_log_test.go:75
Function
TestClickHouseLogTTLExpression
(t *testing.T)
model/clickhouse_log_test.go:69
Function
TestClientCancellationDuringUpstreamRead
(t *testing.T)
pkg/perf_metrics/metrics_test.go:85
Function
TestCloneMetaDeepCopiesSupports
(t *testing.T)
pkg/jsplugin/protocol_supports_test.go:181
Function
TestCloseChannelClosesRegisteredConnectionsOnce
(t *testing.T)
pkg/wsmanager/wsmanager_test.go:25
Function
TestCloseChannelDoesNotCloseOtherChannels
(t *testing.T)
pkg/wsmanager/wsmanager_test.go:50
Function
TestCloseIdleConnectionsRedialsHTTP2
(t *testing.T)
service/http_client_transport_test.go:541
Function
TestCloudflareEmbeddingResponseCompatibility
(t *testing.T)
controller/channel_test_request_test.go:252
Function
TestCollectPendingApplyUpstreamModelChanges
(t *testing.T)
controller/channel_upstream_update_test.go:482
Function
TestCollectPendingUpstreamModelChangesFromModels_WithIgnoredRegexPatterns
(t *testing.T)
controller/channel_upstream_update_test.go:524
Function
TestCollectPendingUpstreamModelChangesFromModels_WithModelMapping
(t *testing.T)
controller/channel_upstream_update_test.go:510
Function
TestCommittedUserAuthVersionPermanentlyRejectsDelayedCacheFill
(t *testing.T)
model/user_cache_auth_version_test.go:177
Function
TestCompileCache_SameResult
--------------------------------------------------------------------------- Compile Cache ------------------------------------------------------------
pkg/billingexpr/billingexpr_test.go:528
Function
TestCompileError
--------------------------------------------------------------------------- Compile errors -----------------------------------------------------------
pkg/billingexpr/billingexpr_test.go:517
Function
TestCompileIgnoresSourceMapDirectives
(t *testing.T)
pkg/jsplugin/engine_test.go:675
Function
TestCompileInterruptsLongRunningInitialization
(t *testing.T)
pkg/jsplugin/engine_test.go:1268
Function
TestCompileRejectsAsynchronousAndImportedPlugins
(t *testing.T)
pkg/jsplugin/engine_test.go:642
Function
TestCompleteSubscriptionOrder_RejectsMismatchedPaymentProvider
(t *testing.T)
model/payment_method_guard_test.go:143
Function
TestComposeTieredTextQuotaErrorFallbackUsesPreConsumedQuota
(t *testing.T)
service/text_quota_test.go:1181
Function
TestComposeTieredTextQuotaFallbackKeepsToolCallSurcharges
(t *testing.T)
service/text_quota_test.go:1143
Function
TestComposeTieredTextQuotaKeepsToolCallSurcharges
(t *testing.T)
service/text_quota_test.go:1088
Function
TestComputeTieredQuotaWithRequest_ProbeAffectsQuota
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:850
Function
TestComputeTieredQuota_Basic
--------------------------------------------------------------------------- Settlement ---------------------------------------------------------------
pkg/billingexpr/billingexpr_test.go:453
Function
TestComputeTieredQuota_BasicSettlement
--------------------------------------------------------------------------- Settlement-level tests for ComputeTieredQuota ----------------------------
pkg/billingexpr/billingexpr_test.go:745
Function
TestComputeTieredQuota_BoundaryTierCrossing
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:887
Function
TestComputeTieredQuota_ClampOnOverflow
TestComputeTieredQuota_ClampOnOverflow guards the billing-safety invariant that an oversized tiered settlement clamps to the single-request max instea
pkg/billingexpr/settle_clamp_test.go:16
Function
TestComputeTieredQuota_NoClampInRange
TestComputeTieredQuota_NoClampInRange confirms an in-range settlement leaves Clamp nil, so the audit path is a no-op in the common case.
pkg/billingexpr/settle_clamp_test.go:39
Function
TestComputeTieredQuota_RoundingEdge
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:810
Function
TestComputeTieredQuota_RoundingEdgeDown
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:830
Function
TestComputeTieredQuota_SameTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:484
Function
TestComputeTieredQuota_WithCache
--------------------------------------------------------------------------- Settlement with cache tokens ---------------------------------------------
pkg/billingexpr/billingexpr_test.go:676
Function
TestComputeTieredQuota_WithCacheCrossTier
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:708
Function
TestComputeTieredQuota_WithGroupRatio
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:771
Function
TestComputeTieredQuota_ZeroTokens
(t *testing.T)
pkg/billingexpr/billingexpr_test.go:791
Function
TestConcurrentRejectionsRefreshOnce
(t *testing.T)
router/provider_plugin_relay_test.go:1058
Function
TestConfigAddressRoutes
(t *testing.T)
pkg/jsplugin/channel_config_test.go:87
Function
TestConfigSchemaContract
(t *testing.T)
pkg/jsplugin/registry_test.go:1323
Function
TestConfigureTrustedProxiesAcceptsTrimmedIPsAndCIDRs
(t *testing.T)
middleware/trusted_proxies_test.go:88
Function
TestConfigureTrustedProxiesDefaultRejectsPublicPeerHeaders
(t *testing.T)
middleware/trusted_proxies_test.go:58
Function
TestConfigureTrustedProxiesDefaultStopsAtPublicClientInForwardedChain
(t *testing.T)
middleware/trusted_proxies_test.go:68
Function
TestConfigureTrustedProxiesDefaultsToLoopbackAndPrivateNetworks
(t *testing.T)
middleware/trusted_proxies_test.go:32
Function
TestConfigureTrustedProxiesNoneDisablesForwardedHeaders
(t *testing.T)
middleware/trusted_proxies_test.go:78
Function
TestConfigureTrustedProxiesRejectsInvalidConfiguration
(t *testing.T)
middleware/trusted_proxies_test.go:107
Function
TestConsumeAuthFlowWithActionRollsBackTogether
(t *testing.T)
model/auth_flow_test.go:84
Function
TestContainerCPUSaturation
(t *testing.T)
common/system_monitor_test.go:29
Function
TestContainerCPUSaturationFallsBackWithoutQuota
(t *testing.T)
common/system_monitor_test.go:90
Function
TestContainerMemoryUsageFallsBackWhenUnavailable
(t *testing.T)
common/system_monitor_test.go:162
Function
TestContainerMemoryUsageUsesWorkingSet
(t *testing.T)
common/system_monitor_test.go:110
Function
TestContentModerationImagesAndDocuments
Images in the user message go to the moderation API one per request, an inline one as its data and a remote one by URL; documents go as text.
plugins/request_plugins_test.go:1379
Function
TestContentModerationLongText
A text the size limit of one moderation request cannot carry goes in pieces, over as many requests as a hook may make; a longer one is rejected withou
plugins/request_plugins_test.go:846
Function
TestContentModerationPlugin
(t *testing.T)
plugins/request_plugins_test.go:608
Function
TestContentModerationReply
(t *testing.T)
plugins/request_plugins_test.go:804
Function
TestContentModerationTaskSubmissions
(t *testing.T)
plugins/request_plugins_test.go:1096
← previous
next →
12,101–12,200 of 15,409, ranked by callers