Documentation
¶
Index ¶
- func NewSingleModelProvider(cfg *op.ModelConfig) (ai.CanonicalProvider, error)
- type APIProvider
- type CanonicalRequest
- type Config
- type LogicalModel
- type PoolPolicy
- type ProviderEndpoint
- type ProviderFactory
- type ResolveOptions
- type ResolvedModel
- type ResolvedRouteCandidate
- type ResponsesRequest
- type RetryPolicy
- type RouteCandidate
- type Runtime
- type StickyPolicy
- type StickyScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSingleModelProvider ¶
func NewSingleModelProvider(cfg *op.ModelConfig) (ai.CanonicalProvider, error)
Types ¶
type APIProvider ¶
type APIProvider = ai.CanonicalProvider
type CanonicalRequest ¶
type CanonicalRequest struct {
ModelID string
// ThreadID is the durable thread/chat identity.
ThreadID string
// SessionID is an optional transport/provider session hint, not transcript truth.
SessionID string
Params *ai.ProviderRequest
}
type Config ¶
type Config struct {
Providers []ProviderEndpoint
Models []LogicalModel
RetryPolicy RetryPolicy
StickyPolicy StickyPolicy
PoolPolicy PoolPolicy
}
type LogicalModel ¶
type PoolPolicy ¶
type ProviderEndpoint ¶
type ProviderFactory ¶
type ProviderFactory func(ctx context.Context, endpoint ProviderEndpoint, model LogicalModel, candidate RouteCandidate, httpClient *http.Client) (APIProvider, error)
type ResolveOptions ¶
type ResolvedModel ¶
type ResolvedModel struct {
Model LogicalModel
Candidates []ResolvedRouteCandidate
}
type ResolvedRouteCandidate ¶
type ResolvedRouteCandidate struct {
Candidate RouteCandidate
Endpoint ProviderEndpoint
}
type ResponsesRequest ¶
type ResponsesRequest struct {
ModelID string
// ThreadID is the durable thread/chat identity.
ThreadID string
// SessionID is an optional transport/provider session hint, not transcript truth.
SessionID string
Params *ai.ResponsesRequest
}
type RetryPolicy ¶
type RouteCandidate ¶
type Runtime ¶
type Runtime interface {
ResolveModel(modelID string, opts ResolveOptions) (*ResolvedModel, error)
CompleteCanonical(ctx context.Context, req *CanonicalRequest) (*ai.ProviderResponse, error)
StreamCanonical(ctx context.Context, req *CanonicalRequest) (*ai.ProviderEventStream, error)
CompleteResponses(ctx context.Context, req *ResponsesRequest) (*ai.ResponsesResult, error)
StreamResponses(ctx context.Context, req *ResponsesRequest) (*ai.ResponsesEventStream, error)
ListModels() []LogicalModel
}
func NewWithFactory ¶
func NewWithFactory(config Config, factory ProviderFactory) (Runtime, error)
type StickyPolicy ¶
type StickyPolicy struct {
Scope StickyScope
TTL time.Duration
}
type StickyScope ¶
type StickyScope string
const ( StickyScopeNone StickyScope = "" // StickyScopeThread uses the durable thread identity as the routing key. // This is the default for thread chat flows in opagent. StickyScopeThread StickyScope = "thread" // StickyScopeSession uses an optional transport/provider session hint. // It is not the persisted thread identity and should only be used when a // caller explicitly wants session-scoped stickiness outside normal thread chat. StickyScopeSession StickyScope = "session" )
Click to show internal directories.
Click to hide internal directories.