Documentation
¶
Overview ¶
Package llmcall resolves adaptive-router choices and assembles one OpenRouter call. Recovery and multi-turn behavior belong to the caller and steploop.
Index ¶
Constants ¶
View Source
const OutputTokenMax = 32_000
Variables ¶
This section is empty.
Functions ¶
func HasToolCalls ¶
func HasToolCalls(messages []msgmodel.ModelMessage) bool
HasToolCalls reports whether any message carries a tool call or tool result. Only array content is inspected.
Types ¶
type ClientFactory ¶
type ClientFactory interface {
Client(ctx context.Context, model Model, choice *adaptive.RouteChoice, router *adaptive.AdaptiveModelRouter) (StreamClient, error)
}
type ClientFactoryFunc ¶
type ClientFactoryFunc func(context.Context, Model, *adaptive.RouteChoice, *adaptive.AdaptiveModelRouter) (StreamClient, error)
func (ClientFactoryFunc) Client ¶
func (f ClientFactoryFunc) Client(ctx context.Context, model Model, choice *adaptive.RouteChoice, router *adaptive.AdaptiveModelRouter) (StreamClient, error)
type Model ¶
type Model struct {
ProviderID string
ID string
APIID string
Params orclient.RequestParams
}
type ModelResolver ¶
type ModelResolverFunc ¶
type OpenRouterClientFactory ¶
OpenRouterClientFactory wires a configured endpoint builder to llmcall.
func (OpenRouterClientFactory) Client ¶
func (f OpenRouterClientFactory) Client(ctx context.Context, model Model, choice *adaptive.RouteChoice, router *adaptive.AdaptiveModelRouter) (StreamClient, error)
type ResolvedCall ¶
type ResolvedCall struct {
Model Model
Choice *adaptive.RouteChoice
Candidates []adaptive.ModelCandidate
Params orclient.RequestParams
}
type Service ¶
type Service struct {
Models ModelResolver
Clients ClientFactory
Router *adaptive.AdaptiveModelRouter
DisableRouting bool
}
func (*Service) ResolveAndAssemble ¶
func (s *Service) ResolveAndAssemble(ctx context.Context, input StreamInput) (ResolvedCall, error)
ResolveAndAssemble picks the model (through the router when one is enabled) and assembles the request parameters. A failed routed-model lookup is registered immediately and the incoming model remains usable.
type StreamClient ¶
Click to show internal directories.
Click to hide internal directories.