Documentation
¶
Overview ¶
Package clients provides provider client registry functions. This package is separate from the providers source to avoid circular dependencies.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FetchRawResult ¶ added in v0.0.21
type FetchRawResult struct {
Data []byte
Response *http.Response
Latency time.Duration
RequestURL string
}
FetchRawResult contains the result of a raw fetch operation.
func FetchRaw ¶
func FetchRaw(ctx context.Context, provider *catalogs.Provider, endpoint string) (*FetchRawResult, error)
FetchRaw fetches raw response data from a provider's API endpoint. This function is used for fetching raw API responses for testdata generation. Returns a FetchRawResult containing the data, response headers, latency, and URL.
type ProviderClient ¶
type ProviderClient interface {
// ListModels retrieves all available models from the provider.
ListModels(ctx context.Context) ([]catalogs.Model, error)
// isAPIKeyRequired returns true if the client requires an API key.
IsAPIKeyRequired() bool
// HasAPIKey returns true if the client has an API key.
HasAPIKey() bool
}
ProviderClient defines the interface for provider API clients. Each provider implementation must satisfy this interface to fetch model information.
func NewProvider ¶
func NewProvider(provider *catalogs.Provider) (ProviderClient, error)
NewProvider creates a new provider client for the given provider.