gateway

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package gateway reads the aggregate usage report a forwarding gateway publishes for the upstream accounts it brokers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadRoutes

func ReadRoutes(ctx context.Context, transport http.RoundTripper, resolve func(context.Context) ([]Route, error), providerID string, fallback wire.AccountUsageResponse) (wire.AccountUsageResponse, error)

ReadRoutes asks each route for the provider's section in order and answers with the first that covers it. A route without an http base or a bearer is skipped. The resolver rechecks the native routes after every read; a changed binding discards the observation. When no route covers the provider, fallback answers.

Types

type Model

type Model struct {
	ID            string
	Name          string
	ContextWindow int64
	MaxTokens     int64
	// Inputs is the gateway's own list of input modalities; nil means it
	// reported none.
	Inputs []string
}

Model is one entry of a gateway's model list.

func Models

func Models(ctx context.Context, transport http.RoundTripper, route Route) ([]Model, error)

Models reads the model list a gateway publishes at the route's base with the bearer the harness sends there, in the gateway's order. A base that publishes no list answers none.

type Route

type Route struct {
	Provider string
	BaseURL  string
	Token    string
}

Route is one custom provider route a harness is configured with: the base it sends requests to and the bearer it sends there.

Jump to

Keyboard shortcuts

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