mirror of
https://github.com/router-for-me/CLIProxyAPI.git
synced 2026-02-03 04:50:52 +08:00
The Gemini Web API client logic has been relocated from `internal/client/gemini-web` to a new, more specific `internal/provider/gemini-web` package. This refactoring improves code organization and modularity by better isolating provider-specific implementations. As a result of this move, the `GeminiWebState` struct and its methods have been exported (capitalized) to make them accessible from the executor. All call sites have been updated to use the new package path and the exported identifiers.
48 lines
795 B
Go
48 lines
795 B
Go
package geminiwebapi
|
|
|
|
type AuthError struct{ Msg string }
|
|
|
|
func (e *AuthError) Error() string {
|
|
if e.Msg == "" {
|
|
return "authentication error"
|
|
}
|
|
return e.Msg
|
|
}
|
|
|
|
type APIError struct{ Msg string }
|
|
|
|
func (e *APIError) Error() string {
|
|
if e.Msg == "" {
|
|
return "api error"
|
|
}
|
|
return e.Msg
|
|
}
|
|
|
|
type ImageGenerationError struct{ APIError }
|
|
|
|
type GeminiError struct{ Msg string }
|
|
|
|
func (e *GeminiError) Error() string {
|
|
if e.Msg == "" {
|
|
return "gemini error"
|
|
}
|
|
return e.Msg
|
|
}
|
|
|
|
type TimeoutError struct{ GeminiError }
|
|
|
|
type UsageLimitExceeded struct{ GeminiError }
|
|
|
|
type ModelInvalid struct{ GeminiError }
|
|
|
|
type TemporarilyBlocked struct{ GeminiError }
|
|
|
|
type ValueError struct{ Msg string }
|
|
|
|
func (e *ValueError) Error() string {
|
|
if e.Msg == "" {
|
|
return "value error"
|
|
}
|
|
return e.Msg
|
|
}
|