huggingface

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HubAPIEndpointScheme = "https://"
	HubAPIEndpointDomain = "huggingface.co"
)

Variables

This section is empty.

Functions

func IsHfAPIError

func IsHfAPIError(err error) bool

Types

type HfAPI

type HfAPI interface {
	WhoAmI(ctx context.Context, token string) (*HfAPIWhoAmIResponse, error)
}

type HfAPIAccessToken

type HfAPIAccessToken struct {
	CreatedAt   time.Time `json:"createdAt"`
	DisplayName string    `json:"displayName"`
	Role        string    `json:"role"`
}

type HfAPIError

type HfAPIError struct {
	HfAPIErrorResponse
}

func (*HfAPIError) Error

func (e *HfAPIError) Error() string

type HfAPIErrorResponse

type HfAPIErrorResponse struct {
	Error string `json:"error"`
}

type HfAPIWhoAmIResponse

type HfAPIWhoAmIResponse struct {
	Auth          HfAPIWhoAmIResponseAuth `json:"auth"`
	AvatarURL     string                  `json:"avatarUrl"`
	CanPay        bool                    `json:"canPay"`
	Email         string                  `json:"email"`
	EmailVerified bool                    `json:"emailVerified"`
	Fullname      string                  `json:"fullname"`
	ID            string                  `json:"id"`
	IsPro         bool                    `json:"isPro"`
	Name          string                  `json:"name"`
	Type          string                  `json:"type"`
}

type HfAPIWhoAmIResponseAuth

type HfAPIWhoAmIResponseAuth struct {
	AccessToken HfAPIAccessToken `json:"accessToken"`
	Type        string           `json:"type"`
}

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL