SYMBOL INDEX (222 symbols across 28 files) FILE: .github/close_issue.py function get_stargazers (line 14) | def get_stargazers(repo): function get_issues (line 40) | def get_issues(repo): function close_issue (line 68) | def close_issue(repo, issue_number): function lock_issue (line 82) | def lock_issue(repo, issue_number): FILE: check/check.go function CheckEnvVariable (line 12) | func CheckEnvVariable() { FILE: common/config/config.go type RateLimitCookie (line 67) | type RateLimitCookie struct function AddRateLimitCookie (line 75) | func AddRateLimitCookie(cookie string, expirationTime time.Time) { type CookieManager (line 82) | type CookieManager struct method RemoveCookie (line 185) | func (cm *CookieManager) RemoveCookie(cookieToRemove string) error { method GetNextCookie (line 218) | func (cm *CookieManager) GetNextCookie() (string, error) { method GetRandomCookie (line 230) | func (cm *CookieManager) GetRandomCookie() (string, error) { function InitGSCookies (line 94) | func InitGSCookies() { function RemoveCookie (line 115) | func RemoveCookie(cookieToRemove string) { function GetGSCookies (line 132) | func GetGSCookies() []string { function NewCookieManager (line 143) | func NewCookieManager() *CookieManager { function IsRateLimited (line 177) | func IsRateLimited(cookie string) bool { type SessionKey (line 247) | type SessionKey struct type SessionManager (line 253) | type SessionManager struct method AddSession (line 266) | func (sm *SessionManager) AddSession(cookie string, model string, chat... method GetChatID (line 278) | func (sm *SessionManager) GetChatID(cookie string, model string) (stri... method DeleteSession (line 291) | func (sm *SessionManager) DeleteSession(cookie string, model string) { method GetChatIDsByCookie (line 303) | func (sm *SessionManager) GetChatIDsByCookie(cookie string) []string { function NewSessionManager (line 259) | func NewSessionManager() *SessionManager { type SessionMapManager (line 316) | type SessionMapManager struct method GetCurrentKeyValue (line 338) | func (sm *SessionMapManager) GetCurrentKeyValue() (string, string, err... method GetNextKeyValue (line 351) | func (sm *SessionMapManager) GetNextKeyValue() (string, string, error) { method GetRandomKeyValue (line 365) | func (sm *SessionMapManager) GetRandomKeyValue() (string, string, erro... method AddKeyValue (line 380) | func (sm *SessionMapManager) AddKeyValue(key, value string) { method RemoveKey (line 392) | func (sm *SessionMapManager) RemoveKey(key string) { method GetSize (line 418) | func (sm *SessionMapManager) GetSize() int { function NewSessionMapManager (line 323) | func NewSessionMapManager() *SessionMapManager { FILE: common/env/helper.go function Bool (line 8) | func Bool(env string, defaultValue bool) bool { function Int (line 15) | func Int(env string, defaultValue int) int { function Float64 (line 26) | func Float64(env string, defaultValue float64) float64 { function String (line 37) | func String(env string, defaultValue string) string { FILE: common/helper/helper.go function OpenBrowser (line 16) | func OpenBrowser(url string) { function GetIp (line 32) | func GetIp() (ip string) { function Bytes2Size (line 63) | func Bytes2Size(num int64) string { function Interface2String (line 81) | func Interface2String(inter interface{}) string { function UnescapeHTML (line 93) | func UnescapeHTML(x string) interface{} { function IntMax (line 97) | func IntMax(a int, b int) int { function GenRequestID (line 105) | func GenRequestID() string { function GetResponseID (line 109) | func GetResponseID(c *gin.Context) string { function Max (line 114) | func Max(a int, b int) int { function AssignOrDefault (line 122) | func AssignOrDefault(value string, defaultValue string) string { function MessageWithRequestId (line 129) | func MessageWithRequestId(message string, id string) string { function String2Int (line 133) | func String2Int(str string) int { FILE: common/helper/key.go constant RequestIdKey (line 4) | RequestIdKey = "X-Request-Id" FILE: common/helper/time.go function GetTimestamp (line 8) | func GetTimestamp() int64 { function GetTimeString (line 12) | func GetTimeString() string { FILE: common/init.go function printHelp (line 21) | func printHelp() { function init (line 28) | func init() { FILE: common/loggger/logger.go constant loggerDEBUG (line 19) | loggerDEBUG = "DEBUG" constant loggerINFO (line 20) | loggerINFO = "INFO" constant loggerWarn (line 21) | loggerWarn = "WARN" constant loggerError (line 22) | loggerError = "ERR" function SetupLogger (line 27) | func SetupLogger() { function SysLog (line 41) | func SysLog(s string) { function SysError (line 46) | func SysError(s string) { function Debug (line 51) | func Debug(ctx context.Context, msg string) { function Info (line 57) | func Info(ctx context.Context, msg string) { function Warn (line 61) | func Warn(ctx context.Context, msg string) { function Error (line 65) | func Error(ctx context.Context, msg string) { function Debugf (line 69) | func Debugf(ctx context.Context, format string, a ...any) { function Infof (line 73) | func Infof(ctx context.Context, format string, a ...any) { function Warnf (line 77) | func Warnf(ctx context.Context, format string, a ...any) { function Errorf (line 81) | func Errorf(ctx context.Context, format string, a ...any) { function logHelper (line 85) | func logHelper(ctx context.Context, level string, msg string) { function FatalLog (line 99) | func FatalLog(v ...any) { FILE: common/random/main.go function GetUUID (line 10) | func GetUUID() string { constant keyChars (line 16) | keyChars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" constant keyNumbers (line 17) | keyNumbers = "0123456789" function init (line 19) | func init() { function GenerateKey (line 23) | func GenerateKey() string { function GetRandomString (line 40) | func GetRandomString(length int) string { function GetRandomNumberString (line 49) | func GetRandomNumberString(length int) string { function RandRange (line 59) | func RandRange(min, max int) int { FILE: common/rate-limit.go type InMemoryRateLimiter (line 8) | type InMemoryRateLimiter struct method Init (line 14) | func (l *InMemoryRateLimiter) Init(expirationDuration time.Duration) { method clearExpiredItems (line 28) | func (l *InMemoryRateLimiter) clearExpiredItems() { method Request (line 45) | func (l *InMemoryRateLimiter) Request(key string, maxRequestNum int, d... FILE: common/token.go function InitTokenEncoders (line 16) | func InitTokenEncoders() { function getTokenEncoder (line 45) | func getTokenEncoder(model string) *tiktoken.Tiktoken { function getTokenNum (line 62) | func getTokenNum(tokenEncoder *tiktoken.Tiktoken, text string) int { function CountTokenMessages (line 66) | func CountTokenMessages(messages []model.OpenAIChatMessage, model string... constant lowDetailCost (line 120) | lowDetailCost = 85 constant highDetailCostPerTile (line 121) | highDetailCostPerTile = 170 constant additionalCost (line 122) | additionalCost = 85 constant gpt4oMiniLowDetailCost (line 124) | gpt4oMiniLowDetailCost = 2833 constant gpt4oMiniHighDetailCost (line 125) | gpt4oMiniHighDetailCost = 5667 constant gpt4oMiniAdditionalCost (line 126) | gpt4oMiniAdditionalCost = 2833 function countImageTokens (line 131) | func countImageTokens(url string, detail string, model string) (_ int, e... function CountTokenInput (line 172) | func CountTokenInput(input any, model string) int { function CountTokenText (line 186) | func CountTokenText(text string, model string) int { function CountToken (line 191) | func CountToken(text string) int { FILE: common/utils.go function SplitStringByBytes (line 17) | func SplitStringByBytes(s string, size int) []string { function Obj2Bytes (line 47) | func Obj2Bytes(obj interface{}) ([]byte, error) { function GetUUID (line 58) | func GetUUID() string { function RandomElement (line 65) | func RandomElement[T any](slice []T) (T, error) { function SliceContains (line 79) | func SliceContains(slice []string, str string) bool { function IsImageBase64 (line 88) | func IsImageBase64(s string) bool { function IsBase64 (line 110) | func IsBase64(s string) bool { function IsCloudflareBlock (line 134) | func IsCloudflareBlock(data string) bool { function IsCloudflareChallenge (line 142) | func IsCloudflareChallenge(data string) bool { function IsRateLimit (line 171) | func IsRateLimit(data string) bool { function IsNotLogin (line 179) | func IsNotLogin(data string) bool { function IsServerError (line 187) | func IsServerError(data string) bool { function IsServerOverloaded (line 195) | func IsServerOverloaded(data string) bool { function IsFreeLimit (line 203) | func IsFreeLimit(data string) bool { function IsServiceUnavailablePage (line 211) | func IsServiceUnavailablePage(data string) bool { FILE: controller/api.go function InitModelChatMap (line 9) | func InitModelChatMap(c *gin.Context) { FILE: controller/chat.go constant errNoValidCookies (line 24) | errNoValidCookies = "No valid cookies available" constant baseURL (line 28) | baseURL = "https://www.genspark.ai" constant apiEndpoint (line 29) | apiEndpoint = baseURL + "/api/copilot/ask" constant deleteEndpoint (line 30) | deleteEndpoint = baseURL + "/api/project/delete?project_id=%s" constant uploadEndpoint (line 31) | uploadEndpoint = baseURL + "/api/get_upload_personal_image_url" constant chatType (line 32) | chatType = "COPILOT_MOA_CHAT" constant imageType (line 33) | imageType = "COPILOT_MOA_IMAGE" constant videoType (line 34) | videoType = "COPILOT_MOA_VIDEO" constant responseIDFormat (line 35) | responseIDFormat = "chatcmpl-%s" type OpenAIChatMessage (line 38) | type OpenAIChatMessage struct type OpenAIChatCompletionRequest (line 43) | type OpenAIChatCompletionRequest struct function ChatForOpenAI (line 49) | func ChatForOpenAI(c *gin.Context) { function processMessages (line 201) | func processMessages(c *gin.Context, client cycletls.CycleTLS, cookie st... function processUrl (line 227) | func processUrl(c *gin.Context, client cycletls.CycleTLS, cookie string,... function processBytes (line 268) | func processBytes(c *gin.Context, client cycletls.CycleTLS, cookie strin... function fetchImageBytes (line 328) | func fetchImageBytes(url string) ([]byte, error) { function createRequestBody (line 338) | func createRequestBody(c *gin.Context, client cycletls.CycleTLS, cookie ... function createImageRequestBody (line 393) | func createImageRequestBody(c *gin.Context, cookie string, openAIReq *mo... function createStreamResponse (line 567) | func createStreamResponse(responseId, modelName string, jsonData []byte,... function handleMessageFieldDelta (line 591) | func handleMessageFieldDelta(c *gin.Context, event map[string]interface{... type Content (line 653) | type Content struct function getDetailAnswer (line 657) | func getDetailAnswer(eventMap map[string]interface{}) (string, error) { function handleMessageResult (line 674) | func handleMessageResult(c *gin.Context, event map[string]interface{}, r... function sendSSEvent (line 696) | func sendSSEvent(c *gin.Context, response model.OpenAIChatCompletionResp... function makeRequest (line 708) | func makeRequest(client cycletls.CycleTLS, jsonData []byte, cookie strin... function makeImageRequest (line 731) | func makeImageRequest(client cycletls.CycleTLS, jsonData []byte, cookie ... function makeDeleteRequest (line 752) | func makeDeleteRequest(client cycletls.CycleTLS, cookie, projectId strin... function makeGetUploadUrlRequest (line 789) | func makeGetUploadUrlRequest(client cycletls.CycleTLS, cookie string) (c... function makeUploadRequest (line 824) | func makeUploadRequest(client cycletls.CycleTLS, uploadUrl string, fileB... function handleStreamRequest (line 862) | func handleStreamRequest(c *gin.Context, client cycletls.CycleTLS, cooki... function cheat (line 984) | func cheat(requestBody map[string]interface{}, c *gin.Context, cookie st... function processStreamData (line 1057) | func processStreamData(c *gin.Context, data string, projectId *string, c... function makeStreamRequest (line 1113) | func makeStreamRequest(c *gin.Context, client cycletls.CycleTLS, jsonDat... function handleNonStreamRequest (line 1224) | func handleNonStreamRequest(c *gin.Context, client cycletls.CycleTLS, co... function OpenaiModels (line 1420) | func OpenaiModels(c *gin.Context) { function ImagesForOpenAI (line 1440) | func ImagesForOpenAI(c *gin.Context) { function ImageProcess (line 1477) | func ImageProcess(c *gin.Context, client cycletls.CycleTLS, openAIReq mo... function extractTaskIDs (line 1671) | func extractTaskIDs(responseBody string) (string, []string) { function pollTaskStatus (line 1730) | func pollTaskStatus(c *gin.Context, client cycletls.CycleTLS, taskIDs []... function getBase64ByUrl (line 1799) | func getBase64ByUrl(url string) (string, error) { function safeClose (line 1820) | func safeClose(client cycletls.CycleTLS) { FILE: controller/video.go function VideosForOpenAI (line 21) | func VideosForOpenAI(c *gin.Context) { function VideoProcess (line 54) | func VideoProcess(c *gin.Context, client cycletls.CycleTLS, openAIReq mo... function createVideoRequestBody (line 202) | func createVideoRequestBody(c *gin.Context, cookie string, openAIReq *mo... function makeVideoRequest (line 367) | func makeVideoRequest(client cycletls.CycleTLS, jsonData []byte, cookie ... function extractVideoTaskIDs (line 388) | func extractVideoTaskIDs(responseBody string) (string, []string) { function pollVideoTaskStatus (line 447) | func pollVideoTaskStatus(c *gin.Context, client cycletls.CycleTLS, taskI... FILE: job/cookie.go function LoadCookieTask (line 10) | func LoadCookieTask() { FILE: main.go function main (line 17) | func main() { FILE: middleware/auth.go function isValidSecret (line 12) | func isValidSecret(secret string) bool { function authHelper (line 16) | func authHelper(c *gin.Context) { function authHelperForOpenai (line 30) | func authHelperForOpenai(c *gin.Context) { function Auth (line 53) | func Auth() func(c *gin.Context) { function OpenAIAuth (line 59) | func OpenAIAuth() func(c *gin.Context) { FILE: middleware/cors.go function CORS (line 8) | func CORS() gin.HandlerFunc { FILE: middleware/ip-list.go function IPBlacklistMiddleware (line 11) | func IPBlacklistMiddleware() gin.HandlerFunc { FILE: middleware/logger.go function SetUpLogger (line 9) | func SetUpLogger(server *gin.Engine) { FILE: middleware/rate-limit.go function memoryRateLimiter (line 14) | func memoryRateLimiter(c *gin.Context, maxRequestNum int, duration int64... function rateLimitFactory (line 26) | func rateLimitFactory(maxRequestNum int, duration int64, mark string) fu... function RequestRateLimit (line 34) | func RequestRateLimit() func(c *gin.Context) { FILE: middleware/request-id.go function RequestId (line 9) | func RequestId() func(c *gin.Context) { FILE: model/openai.go type OpenAIChatCompletionRequest (line 5) | type OpenAIChatCompletionRequest struct method AddMessage (line 29) | func (r *OpenAIChatCompletionRequest) AddMessage(message OpenAIChatMes... method PrependMessagesFromJSON (line 33) | func (r *OpenAIChatCompletionRequest) PrependMessagesFromJSON(jsonStri... method SystemMessagesProcess (line 54) | func (r *OpenAIChatCompletionRequest) SystemMessagesProcess(model stri... method FilterUserMessage (line 74) | func (r *OpenAIChatCompletionRequest) FilterUserMessage() { method GetUserContent (line 215) | func (r *OpenAIChatCompletionRequest) GetUserContent() []string { type OpenAIChatCompletionExtraRequest (line 12) | type OpenAIChatCompletionExtraRequest struct type SessionState (line 16) | type SessionState struct type OpenAIChatMessage (line 22) | type OpenAIChatMessage struct type OpenAIErrorResponse (line 88) | type OpenAIErrorResponse struct type OpenAIError (line 92) | type OpenAIError struct type OpenAIChatCompletionResponse (line 99) | type OpenAIChatCompletionResponse struct type OpenAIChoice (line 110) | type OpenAIChoice struct type OpenAIMessage (line 118) | type OpenAIMessage struct type OpenAIUsage (line 123) | type OpenAIUsage struct type OpenAIDelta (line 129) | type OpenAIDelta struct type OpenAIImagesGenerationRequest (line 134) | type OpenAIImagesGenerationRequest struct type VideosGenerationRequest (line 142) | type VideosGenerationRequest struct type VideosGenerationResponse (line 152) | type VideosGenerationResponse struct type VideosGenerationDataResponse (line 157) | type VideosGenerationDataResponse struct type OpenAIImagesGenerationResponse (line 163) | type OpenAIImagesGenerationResponse struct type OpenAIImagesGenerationDataResponse (line 170) | type OpenAIImagesGenerationDataResponse struct type OpenAIGPT4VImagesReq (line 176) | type OpenAIGPT4VImagesReq struct type GetUserContent (line 184) | type GetUserContent interface type OpenAIModerationRequest (line 188) | type OpenAIModerationRequest struct type OpenAIModerationResponse (line 192) | type OpenAIModerationResponse struct type OpenaiModelResponse (line 202) | type OpenaiModelResponse struct type OpenaiModelListResponse (line 210) | type OpenaiModelListResponse struct FILE: router/api-router.go function SetApiRouter (line 12) | func SetApiRouter(router *gin.Engine) { function ProcessPath (line 30) | func ProcessPath(path string) string { FILE: router/main.go function SetRouter (line 7) | func SetRouter(router *gin.Engine) { FILE: yescaptcha/main.go constant defaultAPIEndpoint (line 14) | defaultAPIEndpoint = "https://api.yescaptcha.com" constant createTaskPath (line 15) | createTaskPath = "/createTask" constant getResultPath (line 16) | getResultPath = "/getTaskResult" constant maxRetries (line 17) | maxRetries = 20 constant pollingInterval (line 18) | pollingInterval = 3 * time.Second type Client (line 22) | type Client struct method SolveRecaptchaV3 (line 104) | func (c *Client) SolveRecaptchaV3(ctx context.Context, req RecaptchaV3... method createTask (line 113) | func (c *Client) createTask(ctx context.Context, req RecaptchaV3Reques... method waitForResult (line 161) | func (c *Client) waitForResult(ctx context.Context, taskID string) (st... method getTaskResult (line 188) | func (c *Client) getTaskResult(ctx context.Context, taskID string) (*g... type Options (line 29) | type Options struct function NewClient (line 35) | func NewClient(clientKey string, opts *Options) *Client { type RecaptchaV3Request (line 55) | type RecaptchaV3Request struct type createTaskRequest (line 64) | type createTaskRequest struct type task (line 69) | type task struct type createTaskResponse (line 79) | type createTaskResponse struct type getResultRequest (line 86) | type getResultRequest struct type getResultResponse (line 91) | type getResultResponse struct type solution (line 99) | type solution struct