Documentation
¶
Overview ¶
Package host provides the supported public construction path for executable backend-plugin contract clients.
Index ¶
- type ProtocolViolationError
- type Session
- func (s *Session) Cancel(ctx context.Context, invocation backendplugin.Invocation) error
- func (s *Session) Close(ctx context.Context) error
- func (s *Session) CountTokens(ctx context.Context, req backendplugin.CountTokensRequest) (backendplugin.CountTokensResponse, error)
- func (s *Session) Execute(stream backendplugin.ExecuteStream) error
- func (s *Session) FinalizeBilling(ctx context.Context, req backendplugin.FinalizeBillingRequest) (backendplugin.FinalizeBillingResponse, error)
- func (s *Session) ListModels(ctx context.Context, maxModels uint32) (backendplugin.ListModelsResponse, error)
- func (s *Session) Negotiation() backendplugin.Negotiation
- func (s *Session) ReleasePromptCache(ctx context.Context, req promptcache.ReleaseRequest) error
- func (s *Session) RenewPromptCache(ctx context.Context, req promptcache.RenewRequest) (promptcache.RenewResponse, error)
- func (s *Session) Resolve(ctx context.Context, modelID *string) (backendplugin.ResolvedProfile, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ProtocolViolationError ¶
type ProtocolViolationError struct{ Err error }
ProtocolViolationError preserves the distinction between malformed protocol frames and transport failures for internal host adapters.
func (*ProtocolViolationError) Error ¶
func (e *ProtocolViolationError) Error() string
func (*ProtocolViolationError) Unwrap ¶
func (e *ProtocolViolationError) Unwrap() error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session is the public host-facing configured connector boundary.
func DialConfiguredSession ¶
func DialConfiguredSession(ctx context.Context, conn net.Conn, instanceID, factoryKind string, configYAML []byte, secrets backendplugin.SecretBundle, policy backendplugin.RuntimePolicy) (*Session, backendplugin.ResolvedProfile, error)
DialConfiguredSession negotiates, configures, and resolves a plugin over an already authenticated connection. The caller owns conn until Close.
func NewSessionForTesting ¶
func NewSessionForTesting(client backendpluginv1.BackendPluginClient, conn *grpc.ClientConn, instanceID string, negotiation backendplugin.Negotiation) *Session
NewSession binds an already-created gRPC client to a host session. It is intended for standard-distribution composition tests; connector authors should normally use DialConfiguredSession.
func (*Session) Cancel ¶
func (s *Session) Cancel(ctx context.Context, invocation backendplugin.Invocation) error
func (*Session) CountTokens ¶
func (s *Session) CountTokens(ctx context.Context, req backendplugin.CountTokensRequest) (backendplugin.CountTokensResponse, error)
CountTokens forwards the optional token-counting operation.
func (*Session) Execute ¶
func (s *Session) Execute(stream backendplugin.ExecuteStream) error
Execute forwards the public DTO stream through the gRPC host session.
Executes serialize on one session and with Close through the session lifecycle: Close waits for the active stream to drain before tearing down the transport, and each Execute registers a cancellation that a deadline-bound Close can trigger. The lifecycle mutex is only held for registration, never across the RPC; the execMu serialization below is what Close deliberately does not take.
func (*Session) FinalizeBilling ¶
func (s *Session) FinalizeBilling(ctx context.Context, req backendplugin.FinalizeBillingRequest) (backendplugin.FinalizeBillingResponse, error)
FinalizeBilling forwards the optional billing-finalization operation.
func (*Session) ListModels ¶
func (s *Session) ListModels(ctx context.Context, maxModels uint32) (backendplugin.ListModelsResponse, error)
func (*Session) Negotiation ¶
func (s *Session) Negotiation() backendplugin.Negotiation
Negotiation returns the protocol outcome bound at dial time.
func (*Session) ReleasePromptCache ¶
func (s *Session) ReleasePromptCache(ctx context.Context, req promptcache.ReleaseRequest) error
ReleasePromptCache forwards the optional local-forget operation.
func (*Session) RenewPromptCache ¶
func (s *Session) RenewPromptCache(ctx context.Context, req promptcache.RenewRequest) (promptcache.RenewResponse, error)
RenewPromptCache forwards the optional instance-scoped control operation.
func (*Session) Resolve ¶
func (s *Session) Resolve(ctx context.Context, modelID *string) (backendplugin.ResolvedProfile, error)