routeselect

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package routeselect derives explicit route selectors from model identifiers. Route selectors use "backend-prefix:model" to route requests to a backend family.

Index

Constants

View Source
const HeaderRouteSelector = lipsdk.HeaderRoute

HeaderRouteSelector carries the core routing selector (e.g. stub:gpt-4o-mini).

Variables

This section is empty.

Functions

This section is empty.

Types

type PrefixSet

type PrefixSet map[string]struct{}

func NewPrefixSet

func NewPrefixSet(prefixes []string) PrefixSet

func (PrefixSet) FromModelOrDefault

func (p PrefixSet) FromModelOrDefault(body []byte, defaultRoute string) string

FromModelOrDefault parses body for a model field and returns it when it carries a known inline route prefix. If decoding fails or the model has no known prefix, it returns defaultRoute with surrounding whitespace removed.

func (PrefixSet) InlineOrDefault

func (p PrefixSet) InlineOrDefault(model, defaultRoute string) string

InlineOrDefault returns model when it has a known backend prefix before the colon delimiter. Otherwise it returns defaultRoute with surrounding whitespace removed.

Jump to

Keyboard shortcuts

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