Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/QuantumNous/new-api
/ functions
Functions
11,918 in github.com/QuantumNous/new-api
⨍
Functions
11,918
◇
Types & classes
1,792
↓ 10 callers
Method
SetData
(data any)
model/task.go:74
↓ 10 callers
Method
SetEnabled
(enabled bool)
pkg/jsplugin/registry.go:455
↓ 10 callers
Method
SetGenerationPreparer
(preparer RoutingGenerationPreparer)
pkg/jsplugin/registry.go:607
↓ 10 callers
Method
SetOverrideEnabled
(enabled bool)
pkg/jsplugin/registry.go:477
↓ 10 callers
Function
ShouldPreserveThinkingSuffix
ShouldPreserveThinkingSuffix reports whether the full model name is exempt from host thinking-suffix and @-modifier parsing. Exact blacklist entries m
setting/model_setting/global.go:146
↓ 10 callers
Method
Size
Size 获取数据大小
common/body_storage.go:20
↓ 10 callers
Function
TaskErrorWrapperLocal
(err error, code string, statusCode int)
service/error.go:194
↓ 10 callers
Method
Type
()
service/system_task.go:35
↓ 10 callers
Function
UnlockOrder
UnlockOrder 释放给定订单号的锁
controller/topup.go:378
↓ 10 callers
Function
UsedVars
UsedVars returns the set of identifier names referenced by an expression. The result is cached alongside the compiled program. Returns nil for empty i
pkg/billingexpr/compile.go:273
↓ 10 callers
Function
UsingLogDatabase
(databaseType DatabaseType)
common/database.go:40
↓ 10 callers
Function
addNewRecord
(type_ int, id int, value int)
model/utils.go:44
↓ 10 callers
Function
advancedCustomGinContext
(path string)
relay/channel/advancedcustom/adaptor_test.go:850
↓ 10 callers
Function
createSectionRegistry
(config: SectionRegistryConfig<TSectionId, TSettings, TExtraArgs>)
web/src/features/system-settings/utils/section-registry.ts:49
↓ 10 callers
Function
executeTaskSubmissionWith
( c *gin.Context, relayInfo *relaycommon.RelayInfo, submit taskSubmitAttempt, )
controller/relay.go:595
↓ 10 callers
Function
insertUserForPaymentGuardTest
(t *testing.T, id int, quota int)
model/payment_method_guard_test.go:12
↓ 10 callers
Function
mustRawMessage
(t *testing.T, value any)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req_test.go:353
↓ 10 callers
Function
performHeaderNavRequest
(t *testing.T, handler gin.HandlerFunc, authenticated bool)
middleware/header_nav_test.go:39
↓ 10 callers
Function
processHeaderOverride
processHeaderOverride applies channel header overrides, with placeholder substitution. Supported placeholders: - {api_key}: resolved to the channel AP
relay/channel/api_request.go:196
↓ 10 callers
Function
rawJSONPresent
(raw json.RawMessage)
relaykit/relayconvert/internal/oai_responses/to_oai_chat_req.go:564
↓ 10 callers
Function
resetPricingEndpointTestTables
(t *testing.T)
model/pricing_endpoint_test.go:14
↓ 10 callers
Function
routingProtocolExport
(name string)
pkg/jsplugin/routing_test.go:1040
↓ 10 callers
Function
safeJsonParse
( value: string | undefined | null, options: SafeJsonParseOptions<T> = {} )
web/src/features/system-settings/utils/json-parser.ts:113
↓ 10 callers
Function
securityPasskeyResponse
securityPasskeyResponse acts as a software authenticator at the browser boundary. The handlers still validate the real WebAuthn challenge, origin and
controller/security_enrollment_test.go:364
↓ 10 callers
Function
seedTaskPollingChannel
(t *testing.T, id int, disableSleep bool)
service/task_polling_test.go:163
↓ 10 callers
Function
setupManageUserTestDB
(t *testing.T)
controller/user_manage_test.go:30
↓ 10 callers
Function
setupUserUpdateTestState
(t *testing.T)
model/user_update_test.go:15
↓ 10 callers
Function
triggerRefresh
()
web/src/features/users/components/users-provider.tsx:41
↓ 10 callers
Function
useSearch
()
web/src/context/search-provider.tsx:57
↓ 9 callers
Method
BuildRequestBody
(c *gin.Context, info *relaycommon.RelayInfo)
relay/channel/adapter.go:69
↓ 9 callers
Method
CloseIdleConnections
()
service/http_transport_sharded.go:97
↓ 9 callers
Method
ConvertOpenAIRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.GeneralOpenAIRequest)
relay/channel/adapter.go:22
↓ 9 callers
Function
CountActiveUserSessions
(userID int, now int64)
model/user_session.go:177
↓ 9 callers
Function
DefaultPluginProtocolLimits
()
relay/plugin_protocol.go:41
↓ 9 callers
Method
DialContext
(ctx context.Context, network, addr string)
service/protected_fetch_client.go:170
↓ 9 callers
Function
Distribute
()
middleware/distributor.go:34
↓ 9 callers
Function
EffectiveEffort
(intent Intent)
relaykit/relayconvert/reasoning/intent.go:565
↓ 9 callers
Method
EnsureClaudeConvertInfo
EnsureClaudeConvertInfo lazily creates and returns the mutable OpenAI→Claude stream conversion state. For non-nil receivers, the same instance must be
relaykit/relayconvert/convmeta/meta.go:41
↓ 9 callers
Function
GetBodyStorage
GetBodyStorage 获取请求体存储对象(用于需要多次读取的场景)
common/gin.go:86
↓ 9 callers
Method
GetByChannelType
(channelType int)
pkg/jsplugin/registry.go:445
↓ 9 callers
Function
GetChannelAffinitySetting
()
setting/operation_setting/channel_affinity_setting.go:156
↓ 9 callers
Function
GetJsonString
(data any)
common/str.go:103
↓ 9 callers
Method
GetMaxTokens
()
relaykit/dto/openai_request.go:345
↓ 9 callers
Function
GetModelRatioCopy
()
setting/ratio_setting/model_ratio.go:692
↓ 9 callers
Method
GetModels
()
model/channel.go:294
↓ 9 callers
Function
GetSystemTaskByTaskID
(taskID string)
model/system_task.go:121
↓ 9 callers
Function
GetTokenByKey
(key string, fromDB bool)
model/token.go:280
↓ 9 callers
Function
GetUserQuota
GetUserQuota gets quota from Redis first, falls back to DB if needed
model/user.go:1253
↓ 9 callers
Method
HasChannelMeta
HasChannelMeta reports whether upstream channel information is attached; converters use it to decide if GetUpstreamModelName is meaningful.
relaykit/relayconvert/convmeta/meta.go:23
↓ 9 callers
Function
InitSessionCookieSettings
()
common/session_cookie.go:44
↓ 9 callers
Method
IsNormalEnd
()
relay/common/stream_status.go:88
↓ 9 callers
Function
IsPaymentComplianceConfirmed
()
setting/operation_setting/payment_setting.go:33
↓ 9 callers
Method
JSValue
()
pkg/jsplugin/routing.go:244
↓ 9 callers
Function
LogQuota
(quota int)
logger/logger.go:125
↓ 9 callers
Method
LookupEndpointCandidates
LookupEndpointCandidates returns every legacy provider implementation that can serve one shared model endpoint. Candidate order is deterministic and t
pkg/jsplugin/routing.go:471
↓ 9 callers
Function
NewOpenAIChatBillingUsage
(usage *Usage)
relaykit/dto/billing_usage.go:58
↓ 9 callers
Function
RecalculateTaskQuota
RecalculateTaskQuota 通用的异步差额结算。 actualQuota 是任务完成后的实际应扣额度,与预扣额度 (task.Quota) 做差额结算。 reason 用于日志记录(例如 "token重算" 或 "adaptor调整")。 clamps 可选:若计算 actualQuo
service/task_billing.go:261
↓ 9 callers
Method
RecordError
(msg string)
relay/common/stream_status.go:55
↓ 9 callers
Function
RecordLog
(userId int, logType int, content string)
model/log.go:150
↓ 9 callers
Function
RefreshPricing
RefreshPricing 强制立即重新计算与定价相关的缓存。 该方法用于需要最新数据的内部管理 API, 因此会绕过默认的 1 分钟延迟刷新。
model/pricing_refresh.go:6
↓ 9 callers
Function
RouteTag
(tag string)
middleware/logger.go:13
↓ 9 callers
Method
SetEstimatePromptTokens
func (info *RelayInfo) SetPromptTokens(promptTokens int) { info.promptTokens = promptTokens }
relay/common/relay_info.go:751
↓ 9 callers
Function
SetToolPriceForTest
SetToolPriceForTest injects a tool price and rebuilds the lookup index. Tests only.
setting/operation_setting/tools.go:222
↓ 9 callers
Function
Source
Source returns the embedded factory source for a task plugin key.
plugins/embed.go:35
↓ 9 callers
Function
StringData
(c *gin.Context, str string)
relay/helper/common.go:97
↓ 9 callers
Function
T
T translates a message key using the language from gin context
i18n/i18n.go:90
↓ 9 callers
Method
ToOpenAIError
()
relaykit/types/error.go:180
↓ 9 callers
Function
TokenAuth
()
middleware/auth.go:361
↓ 9 callers
Function
UpdateConfigFromMap
UpdateConfigFromMap 从map更新配置对象(导出函数)
setting/config/config.go:281
↓ 9 callers
Function
UpdateMaxTokenAutoGroups
(value string)
setting/auto_group.go:63
↓ 9 callers
Function
UserSubject
UserSubject is the casbin subject string for a single user.
service/authz/permission.go:20
↓ 9 callers
Function
ValidateV1Meta
ValidateV1Meta applies the metadata constraints published in docs/plugin-api/v1.schema.json to administrator uploads.
pkg/jsplugin/registry.go:1081
↓ 9 callers
Function
authSigningKey
(purpose string)
service/auth_token.go:53
↓ 9 callers
Function
calculateTextToolCallSurcharge
(ctx *gin.Context, relayInfo *relaycommon.RelayInfo, summary *textQuotaSummary)
service/text_quota.go:148
↓ 9 callers
Function
fetchChannelUpstreamModelIDs
(channel *model.Channel)
controller/channel_upstream_update.go:364
↓ 9 callers
Function
formatLogQuota
(quota: number)
web/src/lib/format.ts:237
↓ 9 callers
Function
getChannelAffinityCache
()
service/channel_affinity.go:82
↓ 9 callers
Function
getUserAuthFenceKey
(userId int)
model/user_auth_cache.go:26
↓ 9 callers
Function
insertPricingEndpointAbility
(t *testing.T, channelID int, modelName string)
model/pricing_endpoint_test.go:49
↓ 9 callers
Function
loadHailuoPlugin
(t *testing.T)
plugins/hailuo_responses_test.go:74
↓ 9 callers
Function
newPluginGenerationBuilder
(staticRoutes []gin.RouteInfo, trustedProxies []string, handlers pluginRouteHandlers)
router/plugin-router.go:68
↓ 9 callers
Function
newTestResponsesStreamState
()
relaykit/relayconvert/internal/oai_responses/to_oai_chat_resp_test.go:534
↓ 9 callers
Function
parseQuotaFromDollars
(amount: number)
web/src/lib/format.ts:84
↓ 9 callers
Function
populateUserCache
(user User)
model/user_cache.go:70
↓ 9 callers
Function
rawJSON
(value any)
relaykit/relayconvert/internal/toolconv/decode.go:788
↓ 9 callers
Function
recordManageAuditFor
recordManageAuditFor 记录一条管理审计日志,日志归属于操作者;targetUserId 只表示被操作用户,用于在结构化参数中保留目标上下文。
controller/audit.go:112
↓ 9 callers
Function
retrieveTaskPluginResponse
(c *gin.Context, deps pluginProtocolBridgeDeps)
controller/plugin_protocol.go:929
↓ 9 callers
Function
safeNumberFieldProps
(field: ControllerRenderProps<TFieldValues, TName>)
web/src/features/system-settings/utils/numeric-field.ts:76
↓ 9 callers
Function
setupTelegramOAuthTest
(t *testing.T)
controller/telegram_test.go:59
↓ 9 callers
Function
useApiKeys
()
web/src/features/keys/components/api-keys-provider.tsx:182
↓ 9 callers
Function
useModels
()
web/src/features/models/components/models-provider.tsx:124
↓ 9 callers
Function
useThemeCustomization
()
web/src/context/theme-customization-provider.tsx:260
↓ 9 callers
Function
writeAuthSessionError
(c *gin.Context, err error)
controller/auth_session.go:164
↓ 8 callers
Method
ApplyTick
ApplyTick maps bounded plugin semantics onto host-owned Responses events. taskStatus is the current durable DB status (for example, IN_PROGRESS, SUCCE
relay/plugin_protocol.go:443
↓ 8 callers
Function
BuildTaskPluginView
BuildTaskPluginView converts a persisted task into the deliberately narrow public shape permitted at JavaScript plugin boundaries.
service/task_plugin_view.go:11
↓ 8 callers
Method
Close
()
relay/channel/openai/image_stream_test.go:165
↓ 8 callers
Method
ConvertClaudeRequest
(c *gin.Context, info *relaycommon.RelayInfo, request *dto.ClaudeRequest)
relay/channel/adapter.go:32
↓ 8 callers
Method
CreatedEvent
()
relay/plugin_protocol.go:429
↓ 8 callers
Method
DeleteMany
DeleteMany accepts either fully namespaced keys or raw keys and deletes them. It returns a map keyed by fully namespaced keys.
pkg/cachex/hybrid_cache.go:231
↓ 8 callers
Method
Export
Export returns one module export without exposing Sobek values outside the engine boundary. It is used for declarative exports such as meta.
pkg/jsplugin/engine.go:186
← previous
next →
401–500 of 11,918, ranked by callers