clients

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2025 License: AGPL-3.0 Imports: 11 Imported by: 0

README

clients

import "github.com/agentstation/starmap/internal/sources/clients"

Package clients provides provider client registry functions. This package is separate from the providers source to avoid circular dependencies.

Index

type FetchRawResult

FetchRawResult contains the result of a raw fetch operation.

type FetchRawResult struct {
    Data       []byte
    Response   *http.Response
    Latency    time.Duration
    RequestURL string
}

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

ProviderClient defines the interface for provider API clients. Each provider implementation must satisfy this interface to fetch model information.

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
}

func NewProvider
func NewProvider(provider *catalogs.Provider) (ProviderClient, error)

NewProvider creates a new provider client for the given provider.

Generated by gomarkdoc

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.

Jump to

Keyboard shortcuts

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