上下文与日志
Support · 推荐实现与策略 · 返回本层目录
| 符号 | 类别 | 用途 |
|---|---|---|
ContextAssemblyOptions | interface | Assembly options for placement-based projections. |
ContextBuilder | interface | Compiled builder. It holds no request state and may be shared across invocations. |
ContextBuilderOptions | interface | Shared builder options. |
ContextCompressionCall | interface | One compression request. |
ContextCompressor | interface | Registered compressor handler. |
ContextFragmentConfig | interface | Self-describing fragment declaration: metadata plus a formatter. |
contextHandlerCalls | function | |
ContextHandlerReference | interface | Reference to a registered compressor or selector handler. |
ContextHistoryGrouping | type | How a message history is split into groups for trimming. |
contextHistoryStrategies | constant | |
ContextModelCall | interface | Same runner and same fixed invocation result as public model calls. |
ContextModelRequest | interface | One model call made on behalf of a selector or compressor. |
ContextNodeResult | interface | Outcome of one context node: the built input, its prepared model call and the change report. |
ContextPolicy | type | Declared context policy for one stage. |
contextPolicyCatalog | constant | |
ContextProcessingNodeDefinition | type | Definition accepted by createContextProcessingNode. It is a normal Core WorkflowNode except that the node body is declared here: plan builds the context, update decides the committed state, and policy/handlers/timeout are validated when the node is created. |
ContextProcessingOptions | interface | Runtime inputs for one processing run. |
ContextProcessingReport | interface | Facts recorded for one processing run. |
ContextProjection | type | One declared projection: a single fragment or a placement expanded into fragments. |
ContextRecentHistory | interface | Recent history that compression must keep verbatim. |
ContextReduction | type | One declared reduction step. |
contextReductionCatalog | constant | |
ContextReductionNodeDefinition | type | Definition of a reduction node: one registered step is applied per node run. stepId may be fixed or derived from state, which lets a graph route over several steps. |
ContextSelection | type | Selection is independent of ownership; omitted selection preserves ordered execution. |
ContextSelectionCall | interface | Everything a selector may inspect for one decision. |
ContextSelectionCandidate | interface | Candidate step considered by selection, with its measured cost. |
contextSelectionCatalog | constant | |
ContextSelectionNodeDefinition | type | Definition of a selection node: like a processing node, but update receives chosen step IDs. |
ContextSelectionResult | interface | Selection stage result: the chosen step IDs plus the unchanged stage snapshot. |
ContextSelector | interface | Model or local selector that chooses which reductions to apply. |
ContextStageResult | interface | Result of a selection or reduction stage, before the node's update commits chosen fields. |
ContextStrategy | interface | Validated inputs ready to pass to a context processing node. |
ContextStrategyOptions | type | One history declaration that generates a step, or an explicit step list with optional history fields (fragment, field, preset, targetChars, keepGroups, grouping). |
ContextStrategySettings | type | Shared reduce-policy settings applied to the whole strategy. Trigger and target fields follow the Core policy contract; omitted values fall back to the plan budget or to the trigger. Supplying steps disables generation and uses the explicit list. |
ContextTokenMeasurement | interface | Injected token measurement for token-triggered policies. |
createContextCompressor | function | Build a compressor that asks a model to rewrite one fragment. The request pairs a system instruction with a user message carrying the fragment ID, its current value and the target character count. Only the model's parsed value is returned; the caller decides whether the result fits the reduction contract. |
createContextProcessingNode | function | Create one node that runs the complete context policy and returns the built context. Use this when the graph does not need to route between selection and reduction phases. |
createContextReductionNode | function | Create a node that applies exactly one registered reduction step. Partial plans keep the full budget until final assembly, so intermediate nodes do not shrink the allowance reserved for the reply. |
createContextSelectionNode | function | Create an ordinary node that selects reduction steps without executing them. The node reports the registered step IDs so the graph can route to reduction nodes itself. |
createContextSelector | function | Build a selector that asks a model to pick reduction steps. Without a custom parser the model must answer with a JSON object containing a stepIds array; with a custom parser the application owns that contract but must still return step IDs. |
createContextStrategy | function | Build a reduction policy from one or more history declarations. recent keeps a window of recent groups; continuity summarizes older groups while preserving the most recent originals. Neither preset claims semantic quality, only bounded input size. |
defineContextAssembly | function | Compile ordered context projections into a builder. A projection is either a single fragment (with its own formatter) or a placement whose contribution handler expands to any number of fragments at request time. |
defineContextFragments | function | Compile self-describing fragment declarations into a builder. Each definition carries its own trust, lifetime and size metadata, so no separate metadata catalog is needed. The budget may be a constant or a function of the request input. |
processContext | function | Run a complete context policy in one call: snapshot, execute and finalize. |
reservedContextCalls | function | |
selectContextSteps | function | Choose steps that fit the remaining call budget. Feasibility uses exact trim previews and declared call ceilings; the reply reserve and the selector's own allowance are subtracted before candidates are considered, so neither can be spent on reductions. |
transformContextText | function | Apply a text transform to a fragment value, including strings nested inside objects. Structured values are walked through a JSON round trip, which is what the budget measurement serializes later; values that JSON cannot represent are therefore not preserved. |
validateContextPolicy | function | Validate a complete context policy and every handler it can reference. Handler IDs must be unique and each handler must declare a non-negative integer call ceiling. Reduction targets and selection modes are checked by their own catalog entries. |
validateContextSelection | function | Validate selector declarations and the selection mode they serve. |