modelprovider

package
v0.0.13-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package modelprovider validates the frozen upstream connection supplied to a native Harness.

Index

Constants

This section is empty.

Variables

View Source
var ErrConfiguration = errors.New("invalid model provider configuration")

Functions

func TokenLimitsValid added in v0.0.12

func TokenLimitsValid(contextWindow, maxOutputTokens int32) bool

TokenLimitsValid holds the token-limit rule: unset is zero, and an output limit never exceeds a set context window.

Types

type Protocol

type Protocol string
const (
	Anthropic       Protocol = "anthropic"
	Responses       Protocol = "responses"
	ChatCompletions Protocol = "chat_completions"
)

func Protocols added in v0.0.10

func Protocols() []Protocol

Protocols is the single vocabulary of supported upstream protocol formats. The Harness catalog generator projects it to the TypeScript client.

func (Protocol) Valid

func (p Protocol) Valid() bool

type Provider

type Provider struct {
	Protocol        Protocol `json:"protocol"`
	BaseURL         string   `json:"base_url"`
	APIKey          string   `json:"api_key"`
	ContextWindow   int32    `json:"context_window,omitempty"`
	MaxOutputTokens int32    `json:"max_output_tokens,omitempty"`
}

Provider is the confidential, frozen upstream bundle supplied by Core. Engine selection and model identity remain separate execution inputs.

func ParseProvider

func ParseProvider(raw any) (Provider, error)

func (Provider) Validate

func (p Provider) Validate() error

Jump to

Keyboard shortcuts

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