| 16 | ) |
| 17 | |
| 18 | func authSessionHandler(client tls_client.HttpClient, account *groq.Account, api_key string, proxy string) error { |
| 19 | organization, err := groqHttp.GerOrganizationId(client, api_key, proxy) |
| 20 | if err != nil { |
| 21 | slog.Error("Failed to get organization id", "err", err) |
| 22 | return err |
| 23 | } |
| 24 | account.Organization = organization |
| 25 | global.Cache.Set(organization, api_key, 3*time.Minute) |
| 26 | return nil |
| 27 | } |
| 28 | |
| 29 | func authRefreshHandler(client tls_client.HttpClient, account *groq.Account, api_key string, proxy string) error { |
| 30 | token, err := groqHttp.GetSessionToken(client, api_key, "") |