MCPcopy Index your code
hub / github.com/SMNETSTUDIO/Groq2API / authRefreshHandler

Function authRefreshHandler

router/chat.go:29–43  ·  view source on GitHub ↗
(client tls_client.HttpClient, account *groq.Account, api_key string, proxy string)

Source from the content-addressed store, hash-verified

27}
28
29func authRefreshHandler(client tls_client.HttpClient, account *groq.Account, api_key string, proxy string) error {
30 token, err := groqHttp.GetSessionToken(client, api_key, "")
31 if err != nil {
32 slog.Error("Failed to get session token", "err", err)
33 return err
34 }
35 organization, err := groqHttp.GerOrganizationId(client, token.Data.SessionJwt, proxy)
36 if err != nil {
37 slog.Error("Failed to get organization id", "err", err)
38 return err
39 }
40 account.Organization = organization
41 global.Cache.Set(organization, token.Data.SessionJwt, 3*time.Minute)
42 return nil
43}
44
45func chat(c *gin.Context) {
46 var api_req groq.APIRequest

Callers 2

chatFunction · 0.85
modelsFunction · 0.85

Calls 1

SetMethod · 0.80

Tested by

no test coverage detected