MCPcopy Create free account

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

Functions9,195 in github.com/QuantumNous/new-api

↓ 646 callersFunctioncn
(...inputs: ClassValue[])
web/src/lib/utils.ts:22
↓ 516 callersMethodEqual
(other taskSnapshot)
model/task.go:382
↓ 264 callersMethodSet
(key K, value V)
types/rw_map.go:40
↓ 208 callersMethodContains
Contains 检查 Set 是否包含某个元素
types/set.go:24
↓ 203 callersMethodUnmarshal
(data []byte)
relay/channel/volcengine/protocols.go:306
↓ 172 callersMethodMarshal
()
relay/channel/volcengine/protocols.go:274
↓ 156 callersMethodget
(rawCacheKey string)
service/http_client.go:180
↓ 152 callersFunctionApiError
(c *gin.Context, err error)
common/gin.go:199
↓ 152 callersMethodString
()
relay/channel/volcengine/protocols.go:55
↓ 138 callersFunctionSysLog
(s string)
common/sys_log.go:17
↓ 132 callersMethodGet
(key K)
types/rw_map.go:33
↓ 118 callersMethodReadAll
ReadAll returns a copy of the entire map.
types/rw_map.go:61
↓ 108 callersFunctionUnmarshal
(data []byte, v any)
common/json.go:9
↓ 106 callersMethodError
()
controller/oauth.go:439
↓ 105 callersMethodUnlock
()
controller/user.go:1341
↓ 103 callersMethodAdd
(item T)
types/set.go:14
↓ 98 callersFunctionLogError
(ctx context.Context, msg string)
logger/logger.go:84
↓ 95 callersMethodError
()
oauth/types.go:37
↓ 90 callersFunctionGetTimestamp
()
common/utils.go:264
↓ 87 callersMethodQuery
(params QueryParams)
pkg/perf_metrics/types.go:7
↓ 86 callersMethodLen
()
types/rw_map.go:71
↓ 81 callersFunctionMarshal
(v any)
common/json.go:21
↓ 79 callersMethodCount
Count returns the deduplicated completed image output count before commit capping.
relay/common/tool_usage.go:138
↓ 77 callersMethodDo
(req *HTTPRequest)
pkg/ionet/types.go:16
↓ 75 callersMethodreset
reset clears the per-chunk stopped flag so the object can be reused.
relay/helper/stream_result.go:50
↓ 73 callersMethodError
(context.Context, string, ...any)
model/user_session_migration_test.go:39
↓ 72 callersFunctionApiSuccess
(c *gin.Context, data any)
common/gin.go:213
↓ 68 callersFunctionApplyParamOverride
(jsonData []byte, paramOverride map[string]interface{}, conditionContext map[string]interface{})
relay/common/override.go:138
↓ 68 callersMethodRun
(ctx context.Context, task *model.SystemTask, runnerID string)
service/system_task.go:36
↓ 60 callersFunctionNewError
(err error, errorCode ErrorCode, ops ...NewAPIErrorOptions)
types/error.go:244
↓ 60 callersFunctiononChange
()
web/src/hooks/use-mobile.ts:28
↓ 57 callersFunctionassertJSONEqual
(t *testing.T, want, got string)
relay/common/override_test.go:2288
↓ 55 callersMethodDelete
()
model/user.go:853
↓ 55 callersFunctionLogDebug
(ctx context.Context, msg string, args ...any)
logger/logger.go:88
↓ 53 callersFunctionSysError
(s string)
common/sys_log.go:24
↓ 52 callersFunctionApiErrorMsg
(c *gin.Context, msg string)
common/gin.go:206
↓ 51 callersFunctionCloseResponseBodyGracefully
(httpResponse *http.Response)
service/http.go:16
↓ 50 callersMethodClose
()
relay/channel/minimax/adaptor_test.go:127
↓ 49 callersMethodError
()
relay/common/override.go:76
↓ 49 callersFunctionNewOpenAIError
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
types/error.go:266
↓ 49 callersFunctiontruncateTables
(t *testing.T)
model/task_cas_test.go:67
↓ 45 callersMethodClose
()
middleware/gzip.go:18
↓ 45 callersFunctionLogInfo
(ctx context.Context, msg string)
logger/logger.go:76
↓ 41 callersFunctionRunExpr
RunExpr compiles (with cache) and executes an expression string. The environment exposes: - p, c — prompt / completion tokens (auto-exclud
pkg/billingexpr/run.go:24
↓ 40 callersMethodGet
Get 获取指定配置模块
setting/config/config.go:35
↓ 40 callersFunctionuseUpdateOption
()
web/src/features/system-settings/hooks/use-update-option.ts:41
↓ 38 callersMethodadd
(sample Sample)
pkg/perf_metrics/types.go:89
↓ 37 callersFunctionLogWarn
(ctx context.Context, msg string)
logger/logger.go:80
↓ 36 callersMethodNext
(fromServer []byte, more bool)
common/email_ntlm_auth.go:51
↓ 36 callersMethodUpdate
()
model/task.go:404
↓ 35 callersMethodGetEstimatePromptTokens
()
relay/common/relay_info.go:684
↓ 35 callersFunctioncancel
(notify: boolean)
web/src/features/playground/hooks/use-stream-request.ts:169
↓ 33 callersFunctionlockForUpdate
lockForUpdate makes the next query emit SELECT ... FOR UPDATE so the matched rows stay locked until the surrounding transaction ends. GORM v2 silentl
model/locking.go:20
↓ 32 callersMethodBytes
Bytes 获取全部内容
common/body_storage.go:18
↓ 32 callersFunctionGetUserById
(id int, selectAll bool)
model/user.go:453
↓ 32 callersMethodOpen
(name string)
common/embed-file-system.go:26
↓ 32 callersFunctionSetupApiRequestHeader
(info *common.RelayInfo, c *gin.Context, req *http.Header)
relay/channel/api_request.go:45
↓ 32 callersFunctionStreamScannerHandler
(c *gin.Context, resp *http.Response, info *relaycommon.RelayInfo, dataHandler func(data string, sr *StreamRes
relay/helper/stream_scanner.go:77
↓ 31 callersFunctionApiErrorI18n
ApiErrorI18n returns a translated error message based on the user's language preference key is the i18n message key, args is optional template data
common/gin.go:223
↓ 31 callersFunctionDoApiRequest
(a Adaptor, c *gin.Context, info *common.RelayInfo, requestBody io.Reader)
relay/channel/api_request.go:307
↓ 31 callersMethodRegister
Register 注册一个配置模块
setting/config/config.go:28
↓ 31 callersMethodSave
()
model/channel.go:345
↓ 31 callersMethodWrite
(p []byte)
relay/channel/openai/image_stream_test.go:188
↓ 30 callersFunctiontruncate
--------------------------------------------------------------------------- Seed helpers -------------------------------------------------------------
service/task_billing_test.go:63
↓ 29 callersFunctionErrOptionWithSkipRetry
()
types/error.go:381
↓ 29 callersMethodExists
(prefix string, path string)
common/embed-file-system.go:18
↓ 29 callersMethodWrite
(b []byte)
middleware/audit.go:24
↓ 28 callersMethodClose
()
controller/passkey_test.go:26
↓ 28 callersFunctionGetChannelById
(id int, selectAll bool)
model/channel.go:412
↓ 28 callersMethodScan
(val interface{})
model/task.go:87
↓ 27 callersFunctionExprHashString
ExprHashString returns the SHA-256 hex digest of an expression string.
pkg/billingexpr/types.go:70
↓ 27 callersFunctionchannelActionConfig
( config: ApiRequestConfig = {} )
web/src/features/channels/api.ts:43
↓ 26 callersMethodGetSetting
()
model/user.go:142
↓ 26 callersFunctionUsingMainDatabase
(databaseType DatabaseType)
common/database.go:36
↓ 25 callersFunctionWithOpenAIError
(openAIError OpenAIError, statusCode int, ops ...NewAPIErrorOptions)
types/error.go:317
↓ 24 callersFunctionDecodeJson
(reader io.Reader, v any)
common/json.go:17
↓ 24 callersFunctionIOCopyBytesGracefully
(c *gin.Context, src *http.Response, data []byte)
service/http.go:44
↓ 24 callersFunctionInitChannelCache
()
model/channel_cache.go:26
↓ 24 callersFunctionInterface2String
(inter interface{})
common/utils.go:191
↓ 24 callersMethodStringContent
()
dto/openai_request.go:481
↓ 24 callersFunctionTryTieredSettle
TryTieredSettle checks if the request uses tiered_expr billing and, if so, computes the actual quota using the frozen BillingSnapshot. Returns: - ok=t
service/tiered_settle.go:97
↓ 24 callersFunctionadvancedCustomRelayInfo
(config *dto.AdvancedCustomConfig)
relay/channel/advancedcustom/adaptor_test.go:789
↓ 24 callersFunctionformatQuota
(quota: number)
web/src/lib/format.ts:72
↓ 23 callersMethodGetBaseURL
()
model/channel.go:497
↓ 23 callersFunctionGetHttpClientWithProxy
GetHttpClientWithProxy returns the default client or a cached proxy-enabled client.
service/http_client.go:261
↓ 23 callersMethodGetPageSize
()
common/page_info.go:25
↓ 23 callersMethodInit
Init IsStream bool
relay/channel/adapter.go:17
↓ 23 callersMethodWriteString
(s string)
middleware/audit.go:36
↓ 23 callersMethodaddEventListener
( type: string, listener: (event: Event & { data?: string; readyState?: number }) => void )
web/src/features/playground/hooks/use-stream-request.test.ts:42
↓ 23 callersMethodmakeRequest
makeRequest performs an HTTP request and handles common response processing
pkg/ionet/client.go:99
↓ 23 callersFunctionuseStatus
()
web/src/hooks/use-status.ts:40
↓ 22 callersFunctionGetResponseID
(c *gin.Context)
relay/helper/common.go:174
↓ 22 callersFunctionResponseText2Usage
func GetPromptTokens(textRequest dto.GeneralOpenAIRequest, relayMode int) (int, error) { switch relayMode { case constant.RelayModeChatCompletions:
service/usage_helpr.go:22
↓ 22 callersFunctioncopyToClipboard
(text: string)
web/src/lib/copy-to-clipboard.ts:82
↓ 21 callersMethodGetStartIdx
()
common/page_info.go:17
↓ 21 callersFunctionNewErrorWithStatusCode
(err error, errorCode ErrorCode, statusCode int, ops ...NewAPIErrorOptions)
types/error.go:299
↓ 21 callersFunctionformatTimestampToDate
( timestamp?: number, unit: 'seconds' | 'milliseconds' = 'seconds' )
web/src/lib/format.ts:138
↓ 21 callersFunctionmakeTask
(userId, channelId, quota, tokenId int, billingSource string, subscriptionId int)
service/task_billing_test.go:118
↓ 20 callersMethodDone
Done signals that the handler has finished processing normally (e.g., Dify "message_end"). The stream stops after this chunk.
relay/helper/stream_result.go:39
↓ 20 callersMethodError
Error lets the same typed value serve both as the settlement audit marker and as the fail-fast error returned by strict pre-consume conversions.
common/quota_math.go:42
next →1–100 of 9,195, ranked by callers