Documentation
¶
Index ¶
- Constants
- func ArtifactSupport() engine.ArtifactSupport
- func DiscoveryProfile() engine.DiscoveryProfile
- func ValidateContextDefinition(value definition.Definition) error
- type Adapter
- func (p *Adapter) Compose(ctx context.Context, rootID artifactstore.RootID, ...) (ContextLoadPlan, error)
- func (p *Adapter) List(ctx context.Context, rootID artifactstore.RootID) ([]ContextDocument, error)
- func (p *Adapter) Load(ctx context.Context, rootID artifactstore.RootID, ...) (ContextInspection, error)
- type CompositionDecision
- type CompositionPolicy
- type CompositionStatus
- type ContextContribution
- type ContextDecoder
- type ContextDocument
- type ContextInspection
- type ContextLoadPlan
- type OverflowBehavior
Constants ¶
View Source
const ( DiagnosticCodeContextDocumentTruncated = "workspace.context.document-truncated" DiagnosticCodeContextDocumentExcluded = "workspace.context.document-excluded" DiagnosticCodeContextBudgetExceeded = "workspace.context.budget-exceeded" )
Variables ¶
This section is empty.
Functions ¶
func ArtifactSupport ¶
func ArtifactSupport() engine.ArtifactSupport
func DiscoveryProfile ¶
func DiscoveryProfile() engine.DiscoveryProfile
func ValidateContextDefinition ¶ added in v0.2.11
func ValidateContextDefinition( value definition.Definition, ) error
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
func NewAdapter ¶
func NewAdapter( query *engine.QueryService, runtimePolicy engine.SourceUsePolicy, compositionPolicy CompositionPolicy, ) (*Adapter, error)
func (*Adapter) Compose ¶
func (p *Adapter) Compose( ctx context.Context, rootID artifactstore.RootID, recordIDs []artifactstore.RecordID, ) (ContextLoadPlan, error)
func (*Adapter) List ¶
func (p *Adapter) List( ctx context.Context, rootID artifactstore.RootID, ) ([]ContextDocument, error)
func (*Adapter) Load ¶ added in v0.2.11
func (p *Adapter) Load( ctx context.Context, rootID artifactstore.RootID, recordIDs []artifactstore.RecordID, ) (ContextInspection, error)
type CompositionDecision ¶ added in v0.2.11
type CompositionDecision struct {
RecordID artifactstore.RecordID `json:"recordID"`
Status CompositionStatus `json:"status"`
Code string `json:"code,omitempty"`
OriginalBytes int `json:"originalBytes"`
IncludedBytes int `json:"includedBytes"`
}
type CompositionPolicy ¶ added in v0.2.11
type CompositionPolicy struct {
MaxPromptBytes int `json:"maxPromptBytes"`
MaxDocumentBytes int `json:"maxDocumentBytes"`
Overflow OverflowBehavior `json:"overflow"`
}
func DefaultCompositionPolicy ¶ added in v0.2.11
func DefaultCompositionPolicy() CompositionPolicy
func (CompositionPolicy) Normalized ¶ added in v0.2.11
func (p CompositionPolicy) Normalized() CompositionPolicy
func (CompositionPolicy) Validate ¶ added in v0.2.11
func (p CompositionPolicy) Validate() error
type CompositionStatus ¶ added in v0.2.11
type CompositionStatus string
const ( CompositionIncluded CompositionStatus = "included" CompositionTruncated CompositionStatus = "truncated" CompositionExcluded CompositionStatus = "excluded" CompositionDenied CompositionStatus = "denied" )
type ContextContribution ¶
type ContextContribution struct {
RecordID artifactstore.RecordID `json:"recordID"`
DefinitionDigest artifactstore.Digest `json:"definitionDigest"`
SourceID artifactstore.SourceID `json:"sourceID"`
Locator artifactstore.Locator `json:"locator"`
Priority int `json:"priority"`
Name string `json:"name"`
Role string `json:"role"`
MediaType string `json:"mediaType"`
Content string `json:"content"`
ConventionOrder int `json:"conventionOrder"`
OriginalBytes int `json:"originalBytes"`
IncludedBytes int `json:"includedBytes"`
Truncated bool `json:"truncated"`
}
type ContextDecoder ¶
type ContextDecoder struct{}
func NewContextDecoder ¶
func NewContextDecoder() *ContextDecoder
func (*ContextDecoder) Decode ¶
func (*ContextDecoder) Decode( _ context.Context, candidate discovery.Candidate, ) ([]discovery.Decoded, []artifactstore.Diagnostic)
func (*ContextDecoder) ID ¶
func (*ContextDecoder) ID() artifactstore.DecoderID
func (*ContextDecoder) Recognize ¶
func (*ContextDecoder) Recognize( _ context.Context, candidate discovery.Candidate, ) discovery.Recognition
type ContextDocument ¶ added in v0.2.11
type ContextDocument struct {
RecordID artifactstore.RecordID `json:"recordID"`
RecordRevision uint64 `json:"recordRevision"`
DefinitionDigest artifactstore.Digest `json:"definitionDigest"`
SourceID artifactstore.SourceID `json:"sourceID"`
Locator artifactstore.Locator `json:"locator"`
Priority int `json:"priority"`
Name string `json:"name"`
Role string `json:"role"`
MediaType string `json:"mediaType"`
Enabled bool `json:"enabled"`
State record.State `json:"state"`
CatalogCurrent bool `json:"catalogCurrent"`
RuntimeAllowed bool `json:"runtimeAllowed"`
Diagnostics []artifactstore.Diagnostic `json:"diagnostics,omitempty"`
}
type ContextInspection ¶ added in v0.2.11
type ContextInspection struct {
RootID artifactstore.RootID `json:"rootID"`
CatalogRevision uint64 `json:"catalogRevision"`
Contributions []ContextContribution `json:"contributions"`
Diagnostics []artifactstore.Diagnostic `json:"diagnostics,omitempty"`
}
type ContextLoadPlan ¶
type ContextLoadPlan struct {
RootID artifactstore.RootID `json:"rootID"`
CatalogRevision uint64 `json:"catalogRevision"`
Contributions []ContextContribution `json:"contributions"`
Prompt string `json:"prompt"`
Diagnostics []artifactstore.Diagnostic `json:"diagnostics,omitempty"`
Decisions []CompositionDecision `json:"decisions"`
PromptBytes int `json:"promptBytes"`
}
type OverflowBehavior ¶ added in v0.2.11
type OverflowBehavior string
const ( OverflowTruncate OverflowBehavior = "truncate" OverflowExclude OverflowBehavior = "exclude" )
Click to show internal directories.
Click to hide internal directories.