MCPcopy Create free account

hub / github.com/fruitbars/simple-one-api / functions

Functions289 in github.com/fruitbars/simple-one-api

↓ 1 callersFunctionhandleQianFanStandardRequest
(c *gin.Context, client *http.Client, apiKey, secretKey, model string, clientModel string, configAddress strin
pkg/handler/openai_qianfan_handler.go:79
↓ 1 callersFunctionhandleQianFanStreamRequest
(c *gin.Context, client *http.Client, apiKey, secretKey, model string, clientModel string, configAddress strin
pkg/handler/openai_qianfan_handler.go:39
↓ 1 callersFunctionhandleRateLimiting
(limiter *mylimiter.Limiter, timeout int)
pkg/embedding/embeddings_handler.go:109
↓ 1 callersFunctionhandleRegularResponse
处理常规响应
pkg/handler/openai_gemini_handler.go:126
↓ 1 callersFunctionhandleResponse
错误和响应处理封装
pkg/handler/openai_ollama_handler.go:41
↓ 1 callersFunctionhandleSingleHuoShanRequest
(ctx context.Context, c *gin.Context, client *arkruntime.Client, huoshanReq model.ChatCompletionRequest, oaiRe
pkg/handler/openai_huoshan_handler.go:156
↓ 1 callersFunctionhandleStreamResponse
处理流响应
pkg/handler/openai_gemini_handler.go:103
↓ 1 callersFunctionhandleXingHuoStandardMode
(c *gin.Context, client *gosparkclient.SparkClient, xhReq *gosparkclient.SparkChatRequest, model string)
pkg/handler/openai_xinghuo_handler.go:135
↓ 1 callersFunctionhandleXingHuoStreamMode
(c *gin.Context, client *gosparkclient.SparkClient, xhReq *gosparkclient.SparkChatRequest, model string)
pkg/handler/openai_xinghuo_handler.go:95
↓ 1 callersFunctioninitAPIKeyMap
()
pkg/config/config.go:457
↓ 1 callersFunctionprepareHuoshanBotRequest
(oaiReq *openai.ChatCompletionRequest)
pkg/handler/openai_huoshan_bot_handler.go:60
↓ 1 callersFunctionprepareHuoshanRequest
(oaiReq *openai.ChatCompletionRequest, s *config.ModelDetails)
pkg/handler/openai_huoshan_handler.go:91
↓ 1 callersFunctionprocessAndSendData
处理并发送流数据
pkg/handler/openai_gemini_handler.go:154
↓ 1 callersFunctionprocessChatStream
(conn *websocket.Conn, chatStream *simple_client.SimpleChatCompletionStream, msgId string, mu *sync.Mutex, mod
pkg/mywebui/multi_model_call.go:130
↓ 1 callersFunctionprocessClaudeStreamEvent
(c *gin.Context, eventType string, eventData string, clientModel string)
pkg/handler/openai_claude_handler.go:156
↓ 1 callersFunctionprocessEvent
处理不同事件类型的通用函数
pkg/handler/openai_dify_handler.go:71
↓ 1 callersFunctionprocessOllamaResponseBody
(c *gin.Context, resp *http.Response, stream bool, oaiReqParam *OAIRequestParam)
pkg/handler/openai_ollama_handler.go:93
↓ 1 callersFunctionqianFanCheckMaxTokens
CheckMaxTokens 根据模型名称和maxtokens参数来校验和调整该参数的取值
pkg/adapter/qianfan_openai.go:51
↓ 1 callersFunctionreadAndUnmarshalClientMessage
(conn *websocket.Conn)
pkg/mywebui/multi_model_call.go:77
↓ 1 callersFunctionsendClaudeRequest
(c *gin.Context, client *http.Client, apiKey, url string, request interface{}, oaiReq *openai.ChatCompletionRe
pkg/handler/openai_claude_handler.go:59
↓ 1 callersFunctionsendOllamaJSONRequest
封装HTTP请求和错误处理
pkg/handler/openai_ollama_handler.go:23
↓ 1 callersFunctionsendRequest
(c *gin.Context, client *http.Client, token, url string, request interface{}, oaiReq *openai.ChatCompletionReq
pkg/handler/openai_cozecn_handler.go:138
↓ 1 callersFunctionsetupLimiter
(s *config.ModelDetails, l *config.Limit, model string)
pkg/embedding/embeddings_handler.go:97
↓ 1 callersFunctionstreamHuoshanResponses
(c *gin.Context, stream *huoshanutils.ChatCompletionStreamReader, oaiReqParam *OAIRequestParam)
pkg/handler/openai_huoshan_handler.go:123
↓ 1 callersFunctiontestNoneStream
()
test/simple_client_test/main.go:59
↓ 1 callersFunctiontestStream
()
test/simple_client_test/main.go:14
↓ 1 callersFunctiontranslateStream
(c *gin.Context, transReq *TranslationV2Request)
pkg/translation/translate_handler_v2.go:29
↓ 1 callersFunctionvalidateAPIKey
(apikey string)
pkg/handler/openai_handler.go:329
↓ 1 callersFunctionvalidateAndFormatURL
validateAndFormatURL checks if the given URL matches the specified formats and returns the formatted URL
pkg/handler/openai_openai_handler.go:41
↓ 1 callersFunctionvalidateMaxTokens
validateMaxTokens 校验和调整maxtokens的值
pkg/adapter/qianfan_openai.go:39
↓ 1 callersFunctionvalidateRequestMethod
(c *gin.Context, method string)
pkg/handler/openai_handler.go:321
↓ 1 callersFunctionwriteHuoshanBotStreamResponse
(c *gin.Context, oaiRespStream *myopenai.OpenAIStreamResponse)
pkg/handler/openai_huoshan_bot_handler.go:213
↓ 1 callersFunctionwriteResponse
将响应数据写入客户端的辅助函数
pkg/handler/openai_dify_handler.go:111
FunctionCallChatMessages
(query, conversationID string, apiKey string, streamMode bool)
pkg/llm/devplatform/dify/chat_message_request/chat_messages.go:42
MethodCloseNotify
()
pkg/simple_client/simple_stream_reader.go:31
FunctionConvertMsgContentBlockDeltaToOpenAIStreamResponse
(msg *claude.MsgContentBlockDelta)
pkg/adapter/claude_stream_resp_openai.go:31
FunctionConvertMsgMessageStartToOpenAIStreamResponse
将 MsgMessageStart 转换为 OpenAIStreamResponse 的函数
pkg/adapter/claude_stream_resp_openai.go:10
FunctionCreateSpeechHandler
CreateSpeechHandler 处理生成音频的请求
pkg/apis/text2speech/text2speech_handler.go:10
FunctionDashScopeBTypeResponseToOpenAIResponse
(llamaResp *common_btype.DSBtypeResponseBody)
pkg/adapter/aliyun-dashscope-adapter/dashscope_btype_openai.go:28
FunctionDashScopeBTypeResponseToOpenAIStreamResponse
(dsResp *common_btype.DSBtypeResponseBody)
pkg/adapter/aliyun-dashscope-adapter/dashscope_btype_openai.go:59
FunctionDashScopeCommonResponseToOpenAIResponse
(dsComResp *ds_com_resp.ModelResponse)
pkg/adapter/aliyun-dashscope-adapter/dashscope_common_openai.go:36
FunctionDashScopeCommonResponseToOpenAIStreamResponse
(dsResp *ds_com_resp.ModelStreamResponse, prevContent string)
pkg/adapter/aliyun-dashscope-adapter/dashscope_common_openai.go:88
FunctionGetAbsolutePath
(path string)
pkg/utils/file_utils.go:10
FunctionGetAbsolutePathDir
(filename string)
pkg/utils/file_utils.go:36
FunctionGetInt
(ptr *int)
pkg/utils/pointer_utils.go:18
FunctionGetStreamResponseContent
(dsResp *ds_com_resp.ModelStreamResponse)
pkg/adapter/aliyun-dashscope-adapter/dashscope_common_openai.go:77
FunctionGetTypeProxyTransport
GetTypeProxyTransport 根据代理类型返回相应的 http.Transport
pkg/config/proxy_strategy.go:66
MethodGoString
()
pkg/llm/google-gemini/gemini_request.go:41
FunctionIsSimpleFileName
IsSimpleFileName checks if the given file name is just a simple file name without any directory path.
pkg/utils/file_utils.go:73
MethodMarshalJSON
MarshalJSON 自定义JSON序列化
pkg/llm/claude/claude_request.go:6
FunctionModelsHandler
(c *gin.Context)
pkg/apis/models_handler.go:18
FunctionMultiSelect
( element, options )
static/jquery/jquery.multiselect.js:98
FunctionOpenAI2AgentBuilderHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_agentbuilder_handler.go:17
FunctionOpenAI2AliyunBaiLianHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_aliyun_bailian_handler.go:5
FunctionOpenAI2AliyunDashScopeHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_aliyun_dashscope_handler.go:53
FunctionOpenAI2AzureOpenAIHandler
OpenAI2AzureOpenAIHandler handles OpenAI to Azure OpenAI requests
pkg/handler/openai_openai_handler.go:258
FunctionOpenAI2ClaudeHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_claude_handler.go:26
FunctionOpenAI2CozecnHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_cozecn_handler.go:40
FunctionOpenAI2DifyHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_dify_handler.go:19
FunctionOpenAI2GeminiHandler
OpenAI2GeminiHandler 主要的处理函数
pkg/handler/openai_gemini_handler.go:40
FunctionOpenAI2GroqOpenAIHandler
OpenAI2GroqOpenAIHandler handles OpenAI to Azure OpenAI requests
pkg/handler/openai_groq_handler.go:27
FunctionOpenAI2HunYuanHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_hunyuan_handler.go:16
FunctionOpenAI2HuoShanHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_huoshan_handler.go:63
FunctionOpenAI2MinimaxHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_minimax_handler.go:21
FunctionOpenAI2OllamaHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_ollama_handler.go:57
FunctionOpenAI2OpenAIHandler
OpenAI2OpenAIHandler handles OpenAI to OpenAI requests
pkg/handler/openai_openai_handler.go:203
FunctionOpenAI2QianFanHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_qianfan_handler.go:15
FunctionOpenAI2VertexAIHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_vertexai_handler.go:35
FunctionOpenAI2XingHuoHandler
(c *gin.Context, oaiReqParam *OAIRequestParam)
pkg/handler/openai_xinghuo_handler.go:43
FunctionOpenAIRequestToDashScopeBTypeRequest
(oaiReq *openai.ChatCompletionRequest)
pkg/adapter/aliyun-dashscope-adapter/dashscope_btype_openai.go:12
FunctionOpenAIRequestToDashScopeCommonRequest
(oaiReq *openai.ChatCompletionRequest)
pkg/adapter/aliyun-dashscope-adapter/dashscope_common_openai.go:12
FunctionQianFanCall
(client *http.Client, api_key, secret_key, model string, configAddress string, qfReq *QianFanRequest)
pkg/llm/baidu-qianfan/qianfan.go:17
FunctionQianFanCallSSE
(client *http.Client, api_key, secret_key, model string, configAddress string, qfReq *QianFanRequest, callback
pkg/llm/baidu-qianfan/qianfan.go:30
FunctionRetrieveModelHandler
RetrieveModelHandler RetrieveModelHandler用于根据模型ID检索模型信息
pkg/apis/models_handler.go:57
MethodRoundTrip
RoundTrip 实现了 http.RoundTripper 接口
pkg/utils/simple_custom_transport_utils.go:15
MethodRoundTrip
RoundTrip 实现了 http.RoundTripper 接口
pkg/utils/custom_transport_utils.go:18
FunctionSendSSERequestWithHttpHeader
(apiKey, url string, reqBody []byte, callback func(data string), httpTransport *http.Transport, header map[str
pkg/utils/http_request.go:101
MethodSize
()
pkg/simple_client/simple_stream_reader.go:64
FunctionTranslateV2Handler
(c *gin.Context)
pkg/translation/translate_handler_v2.go:57
FunctionWSMultiModelCallHandler
(c *gin.Context)
pkg/mywebui/multi_model_call.go:44
MethodWait
(ctx context.Context)
pkg/mylimiter/limiter.go:60
MethodWriteHeader
(statusCode int)
pkg/simple_client/simple_stream_reader.go:46
FunctioncreateLLMTranslationPromptJson
(srcText string, srcLang string, targetLang string)
pkg/translation/llm_translate.go:16
FunctiondetermineFinishReason
(done bool)
pkg/adapter/ollama_openai.go:90
FunctiongetAccessToken
getAccessToken 获取 access_token,如果缓存中存在且未过期,则使用缓存中的 token,否则重新获取
pkg/llm/devplatform/baidu_agentbuilder/agentbuilder.go:31
Functioninit
()
pkg/simple_client/simple_client.go:16
Functionmain
()
main.go:24
Functionmain
()
test/simple_client_test/main.go:86
FunctionsplitOnDoubleNewline
修正后的 splitOnDoubleNewline,不返回空的 token
pkg/llm/devplatform/cozecn_v3/common/cozecn_v3_http_request.go:88
← previous201–289 of 289, ranked by callers