Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Hoshinonyaruko/Gensokyo-llm
/ functions
Functions
763 in github.com/Hoshinonyaruko/Gensokyo-llm
⨍
Functions
763
◇
Types & classes
203
↓ 2 callers
Method
GetUserMemories
(userID int64)
applogic/app.go:614
↓ 2 callers
Method
GetUserMemoriesSP
(userID string)
applogic/app.go:643
↓ 2 callers
Function
GetWenxinMaxOutputTokens
获取WenxinMaxOutputTokens
config/config.go:1105
↓ 2 callers
Function
GetWenxinTopp
获取WenxinTopp
config/config.go:1085
↓ 2 callers
Function
GetWithdrawCommand
获取WithdrawCommand
config/config.go:1247
↓ 2 callers
Function
GetWnxinPenaltyScore
获取WnxinPenaltyScore
config/config.go:1095
↓ 2 callers
Function
Getregion
获取region
config/config.go:80
↓ 2 callers
Method
HandleExit
HandleExit 处理用户退出逻辑,包括发送消息和重置用户状态。
applogic/flow.go:327
↓ 2 callers
Function
Handler
(c *gin.Context, resp *http.Response)
relay/adaptor/openai/main.go:86
↓ 2 callers
Function
IncrementIndex
IncrementIndex 为给定的字符串递增索引
applogic/gensokyo.go:56
↓ 2 callers
Method
Insert
(word, replaceText string)
acnode/acnode.go:74
↓ 2 callers
Method
InsertQAEntry
InsertQAEntry 将新的问题和答案对插入到数据库中
applogic/embeddings.go:142
↓ 2 callers
Function
LoadBlacklist
LoadBlacklist 从给定的文件路径载入黑名单ID。 如果文件不存在,则创建该文件。
utils/blacklist.go:21
↓ 2 callers
Function
LoadConfig
(path string)
config/config.go:29
↓ 2 callers
Method
MatchPositions
(text string)
acnode/acnode.go:217
↓ 2 callers
Function
NewChatCompletionsRequest
()
hunyuan/client.go:48
↓ 2 callers
Function
NewChatProRequest
()
hunyuan/client.go:132
↓ 2 callers
Function
NewChatStdRequest
()
hunyuan/client.go:216
↓ 2 callers
Function
NewGetEmbeddingRequest
()
hunyuan/client.go:302
↓ 2 callers
Function
ParseMessageContent
(message interface{})
applogic/msgpraser.go:11
↓ 2 callers
Function
ReplaceTextIn
ReplaceTextIn 使用给定的替换对列表对文本进行替换
utils/utils.go:3248
↓ 2 callers
Function
ResetIndex
ResetIndex 重置或删除给定字符串的索引
applogic/gensokyo.go:72
↓ 2 callers
Function
SendGroupMessageMdPromptKeyboardSP
(groupID string, userID string, message string, selfid string, newmsg string, response string, promptstr strin
utils/utils.go:738
↓ 2 callers
Function
SendSSEPrivateRestoreMessage
SendSSEPrivateRestoreMessage 分割并发送重置消息的核心逻辑,直接遍历字符串
utils/utils.go:2713
↓ 2 callers
Function
SendSSEPrivateSafeMessage
SendSSEPrivateSafeMessage 分割并发送安全消息的核心逻辑,直接遍历字符串
utils/utils.go:2581
↓ 2 callers
Function
StreamHandler
(c *gin.Context, resp *http.Response)
relay/adaptor/openai/main.go:26
↓ 2 callers
Function
calculateGroupID
(vector []float64)
applogic/embeddings.go:299
↓ 2 callers
Function
checkMessageForHints
checkMessageForHints 检查消息中是否包含给定的提示词
applogic/gensokyo.go:84
↓ 2 callers
Function
checkResponseThreshold
checkResponseThreshold 发送消息并根据返回值决定是否超过阈值
applogic/safecheck.go:28
↓ 2 callers
Function
chooseRandomContent
chooseRandomContent checks for '||' in the content string and randomly selects one option if present
prompt/prompt.go:151
↓ 2 callers
Function
cleanExpiredMessageIDs
cleanExpiredMessageIDs 清理指定user_id的已过期消息ID
utils/utils.go:3005
↓ 2 callers
Function
cleanExpiredMessageIDsSP
cleanExpiredMessageIDs 清理指定user_id的已过期消息ID
utils/utils.go:3016
↓ 2 callers
Method
deleteCustomRecordSP
(userID string)
applogic/promptstr.go:109
↓ 2 callers
Function
getBaiduAccessTokenHelper
(apiKey string)
relay/adaptor/baidu/main.go:281
↓ 2 callers
Function
getFileMd5
生成随机md5图片名,防止碰撞
server/uploadpic.go:235
↓ 2 callers
Function
getRandomItem
(items []string)
applogic/env.go:157
↓ 2 callers
Function
hammingDistanceOptimized
计算两个二进制向量之间的汉明距离 如果向量长度不同,则比较它们的共同长度部分,并忽略较长向量的剩余部分。
applogic/embeddings.go:203
↓ 2 callers
Method
insertVectorData
将向量二值化和对应文本并存储到数据库 insertVectorData插入向量数据并返回新插入行的ID
applogic/embeddings.go:222
↓ 2 callers
Method
insertVectorDataSensitive
将向量二值化和对应文本并存储到数据库 insertVectorData插入向量数据并返回新插入行的ID
applogic/vectorsensitive.go:18
↓ 2 callers
Function
isPublicAddress
判断是否公网ip 填写域名也会被认为是公网,但需要用户自己确保域名正确解析到gensokyo所在的ip地址
server/uploadpic.go:359
↓ 2 callers
Function
loadFile
(filename string)
prompt/prompt.go:98
↓ 2 callers
Method
searchForSingleVector
searchForSingleVector函数根据单个向量搜索并返回按相似度排序的文本数组
applogic/embeddings.go:319
↓ 2 callers
Function
selectBasedOnSenceId
(envItems []string, senceId int)
applogic/env.go:112
↓ 2 callers
Function
sendDeleteRequest
sendDeleteRequest 发送删除消息的请求,并输出响应内容
utils/utils.go:3059
↓ 2 callers
Function
sha256hex
(s string)
relay/adaptor/tencent/main.go:182
↓ 2 callers
Function
shouldAuth
()
common/message/email.go:16
↓ 2 callers
Function
stripPrefix
(s string)
applogic/env.go:140
↓ 2 callers
Method
updateConversationTitle
(userID int64, conversationID, parentMessageID, newTitle string)
applogic/app.go:524
↓ 2 callers
Method
updateConversationTitleSP
(userID string, conversationID, parentMessageID, newTitle string)
applogic/app.go:540
↓ 1 callers
Function
AddSelfID
AddSelfID 添加一个 ID 到全局切片中
server/server.go:40
↓ 1 callers
Method
AddSingleContext
直接根据缓存来储存上下文 其实向量缓存是一个单轮的QA缓存,因为这个项目很初步,很显然无法应对上下文场景的缓存 通过这种方式,将每次缓存的内容也加入上下文,可能会有一个初步的效果提升.
applogic/singlecontext.go:13
↓ 1 callers
Method
AddSingleContextSP
直接根据缓存来储存上下文 其实向量缓存是一个单轮的QA缓存,因为这个项目很初步,很显然无法应对上下文场景的缓存 通过这种方式,将每次缓存的内容也加入上下文,可能会有一个初步的效果提升.
applogic/singlecontext.go:55
↓ 1 callers
Function
AdjustMessageOrder
(messages []relaymodel.Message)
relay/adaptor/tencent/constants.go:77
↓ 1 callers
Method
ApplyPromptChanceQ
ApplyPromptChanceQ 应用promptChanceQ的逻辑,动态修改requestmsg
applogic/flow.go:553
↓ 1 callers
Method
ApplyPromptChoiceA
ApplyPromptChoiceA 应用故事模式的情绪增强逻辑,并返回增强内容。
applogic/flow.go:472
↓ 1 callers
Function
ApplyReplaceTextOutToKeyboardPrompts
(keyboardPrompts []string, promptstr string)
promptkb/promptkb.go:145
↓ 1 callers
Method
ApplySwitchOnA
ApplySwitchOnA 应用switchOnA的逻辑,动态修改promptstr
applogic/flow.go:401
↓ 1 callers
Method
ApplySwitchOnQ
ApplySwitchOnQ 应用switchOnQ的逻辑,动态修改promptstr
applogic/flow.go:199
↓ 1 callers
Function
Base64Encode
(data []byte)
relay/adaptor/ali/image.go:190
↓ 1 callers
Function
BlacklistIntercept
BlacklistIntercept 检查用户ID是否在黑名单中,如果在,则发送预设消息
utils/blacklist.go:96
↓ 1 callers
Function
BlacklistInterceptSP
BlacklistIntercept 检查用户ID是否在黑名单中,如果在,则发送预设消息
utils/blacklist.go:141
↓ 1 callers
Method
BuildFailPointer
()
acnode/acnode.go:87
↓ 1 callers
Method
CalculateTextEmbeddingHunyuan
CalculateTextEmbedding 调用混元-Embedding接口将文本转换为向量表示。
applogic/embeddings.go:89
↓ 1 callers
Method
ChatCompletions
ChatCompletions 腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。 1. 本接口暂不支持返回图片内容。 2. 默认每种模型单账号限制并发数为 5 路,如您
hunyuan/client.go:88
↓ 1 callers
Method
ChatCompletionsWithContext
ChatCompletions 腾讯混元大模型是由腾讯研发的大语言模型,具备强大的中文创作能力,复杂语境下的逻辑推理能力,以及可靠的任务执行能力。本接口支持流式或非流式调用,当使用流式调用时为 SSE 协议。 1. 本接口暂不支持返回图片内容。 2. 默认每种模型单账号限制并发数为 5 路,如您
hunyuan/client.go:116
↓ 1 callers
Method
ChatPro
ChatPro <span style="font-size:1.5em;">注意:本接口将于 5 月 15 日下线;下线后将不再提供文档指引,接口本身可继续调用,建议使用 [hunyuan](https://cloud.tencent.com/document/api/1729/105701) 接
hunyuan/client.go:172
↓ 1 callers
Method
ChatProWithContext
ChatPro <span style="font-size:1.5em;">注意:本接口将于 5 月 15 日下线;下线后将不再提供文档指引,接口本身可继续调用,建议使用 [hunyuan](https://cloud.tencent.com/document/api/1729/105701) 接
hunyuan/client.go:200
↓ 1 callers
Method
ChatStdWithContext
ChatStd <span style="font-size:1.5em;">注意:本接口将于 5 月 15 日下线;下线后将不再提供文档指引,接口本身可继续调用,建议使用 [hunyuan](https://cloud.tencent.com/document/api/1729/105701) 接
hunyuan/client.go:286
↓ 1 callers
Function
CloseAllConnections
()
server/server.go:244
↓ 1 callers
Function
ContainsRune
随机的分布发送
utils/utils.go:175
↓ 1 callers
Function
ContainsRuneSP
随机的分布发送
utils/utils.go:199
↓ 1 callers
Function
ConvertImageRequest
(request model.ImageRequest)
relay/adaptor/ali/main.go:72
↓ 1 callers
Function
ConvertRequest
(request model.GeneralOpenAIRequest)
relay/adaptor/ali/main.go:24
↓ 1 callers
Function
ConvertRequest
(request model.GeneralOpenAIRequest)
relay/adaptor/zhipu/main.go:79
↓ 1 callers
Function
ConvertRequest
(request model.GeneralOpenAIRequest)
relay/adaptor/tencent/main.go:30
↓ 1 callers
Function
ConvertRequest
(request model.GeneralOpenAIRequest)
relay/adaptor/baidu/main.go:57
↓ 1 callers
Method
ConvertRequest
(c *gin.Context, request *model.GeneralOpenAIRequest)
relay/adaptor/interface.go:15
↓ 1 callers
Function
Debug
(ctx context.Context, msg string)
common/logger/logger.go:64
↓ 1 callers
Function
Debugf
(ctx context.Context, format string, a ...any)
common/logger/logger.go:82
↓ 1 callers
Function
DeleteLatestMessage
(messageType string, id int64, userid int64, selfid string)
utils/utils.go:3085
↓ 1 callers
Function
DeleteLatestMessageSP
(messageType string, id string, userid string, selfid string)
utils/utils.go:3148
↓ 1 callers
Function
DoRequest
(c *gin.Context, req *http.Request)
relay/adaptor/common.go:57
↓ 1 callers
Method
DoRequest
(c *gin.Context, requestBody io.Reader)
relay/adaptor/interface.go:17
↓ 1 callers
Method
DoResponse
(c *gin.Context, resp *http.Response)
relay/adaptor/interface.go:18
↓ 1 callers
Method
EnsureCustomTableExist
()
applogic/app.go:181
↓ 1 callers
Method
EnsureCustomTableExistSP
()
applogic/app.go:207
↓ 1 callers
Method
EnsureEmbeddingsTablesExist
问题Q 向量表
applogic/app.go:81
↓ 1 callers
Method
EnsureQATableExist
()
applogic/app.go:140
↓ 1 callers
Method
EnsureSensitiveWordsTableExists
敏感词表
applogic/app.go:112
↓ 1 callers
Method
EnsureTablesExist
()
applogic/app.go:34
↓ 1 callers
Method
EnsureUserContextTableExists
()
applogic/app.go:233
↓ 1 callers
Method
EnsureUserContextTableExistsSP
()
applogic/app.go:266
↓ 1 callers
Method
EnsureUserMemoriesTableExists
记忆表
applogic/app.go:466
↓ 1 callers
Function
Error
(ctx context.Context, msg string)
common/logger/logger.go:78
↓ 1 callers
Function
Errorf
(ctx context.Context, format string, a ...any)
common/logger/logger.go:94
↓ 1 callers
Function
FatalLog
(v ...any)
common/logger/logger.go:112
↓ 1 callers
Function
FetchAndStoreUserIDs
构造 URL 并请求数据
utils/utils.go:82
↓ 1 callers
Function
FilterSystemMessages
FilterSystemMessages - 保留字数最多的一个 system 角色
relay/adaptor/tencent/constants.go:37
↓ 1 callers
Function
Float64
(env string, defaultValue float64)
common/env/helper.go:26
↓ 1 callers
Function
GenRequestID
()
common/helper/helper.go:106
← previous
next →
201–300 of 763, ranked by callers