Clarify shared ownership of namespace views
This commit is contained in:
19
engine.go
19
engine.go
@@ -90,11 +90,12 @@ var (
|
||||
// [Engine.InspectRequirements], [Engine.InspectProfile], [Engine.Prepare], [Engine.PrepareExecution],
|
||||
// [Engine.Run], [Engine.RunPrepared], [Engine.SmokeTest], [Engine.ListProfiles],
|
||||
// [Engine.ListPrompts], [Engine.ListBackends], [Engine.ListNamespaces], and
|
||||
// [Engine.ListCollections]. Each Engine owns
|
||||
// [Engine.ListCollections]. Engines constructed separately by [NewEngine] own
|
||||
// independent backend-capacity pools that coordinate Run, RunPrepared, and
|
||||
// inference SmokeTest admission and model generation. Injected collaborators
|
||||
// may still be invoked concurrently across different backend pools or for
|
||||
// unlimited backends.
|
||||
// inference SmokeTest admission and model generation. Namespace views returned
|
||||
// by [Engine.WithNamespaces] share their underlying engine's pools, clients,
|
||||
// and prepared-execution owner. Injected collaborators may still be invoked
|
||||
// concurrently across different backend pools or for unlimited backends.
|
||||
type Engine struct {
|
||||
internal *internalengine.Engine
|
||||
}
|
||||
@@ -393,8 +394,9 @@ func (e *Engine) prepareRequest(ctx context.Context, req RunRequest) (*domain.Pr
|
||||
// configured LLMClient or reserving backend admission capacity. Validated
|
||||
// RunRequest.AppendedMessages are included in the frozen effective messages.
|
||||
//
|
||||
// The returned opaque handle is bound to this Engine and permits one
|
||||
// [Engine.RunPrepared] invocation. Preparation freezes the selected sources,
|
||||
// The returned opaque handle is bound to this Engine's underlying execution
|
||||
// owner, shared with its namespace views, and permits one [Engine.RunPrepared]
|
||||
// invocation in total. Preparation freezes the selected sources,
|
||||
// rendered messages, effective settings, inputs, provider structured-output
|
||||
// metadata, and validation resources needed by that invocation. The handle
|
||||
// retains a direct RunRequest.APIKey only in private execution state;
|
||||
@@ -506,6 +508,11 @@ func (e *Engine) run(ctx context.Context, req RunRequest) (*RunResult, error) {
|
||||
// RunPrepared atomically claims and executes a handle created by
|
||||
// [Engine.PrepareExecution].
|
||||
//
|
||||
// The originating Engine and namespace views sharing its underlying owner may
|
||||
// claim the handle. Execution uses its captured selections without applying the
|
||||
// invoking view's namespaces. An Engine constructed separately by [NewEngine]
|
||||
// is a foreign owner.
|
||||
//
|
||||
// A valid owning-Engine invocation consumes the handle's one attempt before
|
||||
// credential revalidation, backend admission, generation, or validation.
|
||||
// Cancellation, capacity rejection, generation failure, operational
|
||||
|
||||
Reference in New Issue
Block a user