providerservice

package
v0.28.14 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProviderTypeLocal        = "local"
	ProviderTypeOllama       = "ollama"
	ProviderTypeOpenAI       = "openai"
	ProviderTypeAnthropic    = "anthropic"
	ProviderTypeMistral      = "mistral"
	ProviderTypeBedrock      = "bedrock"
	ProviderTypeGemini       = "gemini"
	ProviderTypeVLLM         = "vllm"
	ProviderTypeVertexGoogle = "vertex-google"
)

Variables

View Source
var ErrInvalidProvider = errors.New("invalid provider")

Functions

This section is empty.

Types

type ConfigureProviderRequest

type ConfigureProviderRequest struct {
	APIKey       string
	APIKeyEnv    string
	BaseURL      string
	DefaultModel string
	Upsert       bool
	SetDefault   bool
}

type ProviderCapability

type ProviderCapability struct {
	Provider             string `json:"provider"`
	DefaultBaseURL       string `json:"defaultBaseUrl,omitempty"`
	RequiresBaseURL      bool   `json:"requiresBaseUrl"`
	RequiresSecretConfig bool   `json:"requiresSecretConfig"`
	RecommendedAPIKeyEnv string `json:"recommendedApiKeyEnv,omitempty"`
}

type ProviderStatus

type ProviderStatus struct {
	Provider             string    `json:"provider"`
	Configured           bool      `json:"configured"`
	BackendID            string    `json:"backendId,omitempty"`
	BackendName          string    `json:"backendName,omitempty"`
	BaseURL              string    `json:"baseUrl,omitempty"`
	SecretSource         string    `json:"secretSource"`
	SecretConfigured     bool      `json:"secretConfigured"`
	SecretPresent        bool      `json:"secretPresent"`
	APIKeyEnv            string    `json:"apiKeyEnv,omitempty"`
	RecommendedAPIKeyEnv string    `json:"recommendedApiKeyEnv,omitempty"`
	DefaultProvider      string    `json:"defaultProvider,omitempty"`
	DefaultModel         string    `json:"defaultModel,omitempty"`
	UpdatedAt            time.Time `json:"updatedAt,omitempty"`
}

type Service

type Service interface {
	Configure(ctx context.Context, providerType string, req ConfigureProviderRequest) (*ProviderStatus, error)
	GetProviderConfig(ctx context.Context, providerType string) (*ProviderStatus, error)
	DeleteProviderConfig(ctx context.Context, providerType string) error
	ListProviderConfigs(ctx context.Context, createdAtCursor *time.Time, limit int) ([]*ProviderStatus, error)
	ListSupportedProviders(ctx context.Context) ([]ProviderCapability, error)
}

func New

func New(dbInstance libdb.DBManager, workspaceID string) Service

Jump to

Keyboard shortcuts

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