namespace AIStudio.Provider;
public enum ProviderRequestFailureReason
{
NONE,
INSUFFICIENT_QUOTA,
TOO_MANY_REQUESTS,
///
/// The provider does not serve the requested model.
///
///
/// This applies to gateways which route to other providers: the model exists, but the one
/// meant to answer for it does not offer it.
///
MODEL_NOT_SUPPORTED_BY_PROVIDER,
///
/// No usable API key was available, or the provider rejected the one we sent.
///
///
/// Both cases lead to the same place for the user: the key stored for this provider is not
/// one the provider works with, and the settings are where they fix it.
///
INVALID_OR_MISSING_API_KEY,
///
/// The key was accepted, but the account is not allowed to do what we asked for.
///
///
/// Typical causes are a key without the required scope, a model the account has no access
/// to, and providers which refuse requests from the user's region.
///
AUTHENTICATION_OR_PERMISSION_ERROR,
///
/// The provider could not be reached, or said that it cannot serve requests right now.
///
PROVIDER_UNAVAILABLE,
///
/// The provider does not know the requested model at all.
///
MODEL_NOT_FOUND,
///
/// The text we sent was longer than the model accepts.
///
CONTEXT_LENGTH_EXCEEDED,
///
/// The provider cannot create embeddings at all.
///
EMBEDDINGS_NOT_SUPPORTED,
///
/// The provider answered successfully, but with something we were not able to read.
///
INVALID_RESPONSE,
///
/// The request failed and we were not able to tell why.
///
///
/// Deliberately without a user message of its own: what the provider itself said about the
/// failure tells the user more than a sentence which says nothing.
///
UNKNOWN,
}