Add token refresh handling for 401 responses across clients

- Implemented `RefreshTokens` method in client interfaces and Gemini clients.
- Updated handlers to call `RefreshTokens` on 401 responses and retry requests if token refresh succeeds.
- Enhanced error handling and retry logic to accommodate token refresh flow.
This commit is contained in:
Luis Pater
2025-08-30 16:10:56 +08:00
parent 1aad033fec
commit 512c8b600a
7 changed files with 46 additions and 0 deletions

View File

@@ -51,4 +51,6 @@ type Client interface {
// Provider returns the name of the AI service provider (e.g., "gemini", "claude").
Provider() string
RefreshTokens(ctx context.Context) error
}