Documentation
¶
Overview ¶
Package pack provides SDK-side loading and conversion for PromptPacks.
The pack data types are the runtime's canonical types, aliased in alias.go. This file adds the behavior the SDK needs on top of them: schema-validated loading, and conversion into the runtime prompt.Registry / tool repository consumed by the pipeline.
Package pack provides internal pack loading functionality.
Index ¶
- func ToPromptRegistry(p *Pack) *prompt.Registry
- func ToToolRepository(p *Pack) *memory.ToolRepository
- func ValidateAgainstSchema(data []byte) error
- type AgentDef
- type AgentsConfig
- type AgentsValidationError
- type LoadOptions
- type MediaConfig
- type Pack
- type Parameters
- type Prompt
- type SchemaValidationError
- type SkillSourceConfig
- type Tool
- type ToolPolicy
- type Validator
- type Variable
- type WorkflowArtifactDef
- type WorkflowSpec
- type WorkflowState
- type WorkflowValidationError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToPromptRegistry ¶ added in v1.5.5
ToPromptRegistry builds a prompt.Registry from the pack so the SDK uses the same PromptAssemblyMiddleware as Arena.
func ToToolRepository ¶ added in v1.5.5
func ToToolRepository(p *Pack) *memory.ToolRepository
ToToolRepository builds a memory.ToolRepository from the pack so the SDK uses the same tools.Registry as Arena. Pack tools are registered with mode "local" as a placeholder; the host binds the real execution mode.
func ValidateAgainstSchema ¶
ValidateAgainstSchema validates pack JSON data against the PromptPack schema. It uses the $schema URL from the pack if present, otherwise uses the embedded schema. The PROMPTKIT_SCHEMA_SOURCE environment variable can override this behavior:
- "local": Always use embedded schema (default, for offline support)
- "remote": Always fetch from URL
- file path: Load schema from local file
Returns nil if validation passes, or a SchemaValidationError with details.
Types ¶
type AgentsConfig ¶ added in v1.3.1
type AgentsConfig = prompt.AgentsConfig
AgentsConfig maps prompts to A2A agent definitions.
type AgentsValidationError ¶ added in v1.3.1
type AgentsValidationError struct {
Errors []string
}
AgentsValidationError represents an agents section validation error with details.
func (*AgentsValidationError) Error ¶ added in v1.3.1
func (e *AgentsValidationError) Error() string
type LoadOptions ¶
type LoadOptions struct {
// SkipSchemaValidation disables JSON schema validation during load.
// Default is false (validation enabled).
SkipSchemaValidation bool
}
LoadOptions configures pack loading behavior.
type MediaConfig ¶
type MediaConfig = prompt.MediaConfig
MediaConfig is a prompt's multimodal media configuration.
type Pack ¶
Pack is the runtime's PromptPack type.
type Parameters ¶
type Parameters = prompt.ParametersPack
Parameters holds model parameters for a prompt.
type SchemaValidationError ¶
type SchemaValidationError struct {
Errors []string
}
SchemaValidationError represents a schema validation error with details.
func (*SchemaValidationError) Error ¶
func (e *SchemaValidationError) Error() string
type SkillSourceConfig ¶ added in v1.3.1
type SkillSourceConfig = prompt.SkillSourceConfig
SkillSourceConfig declares a skill source for the pack.
type ToolPolicy ¶
type ToolPolicy = prompt.ToolPolicyPack
ToolPolicy governs how a prompt may use tools.
type WorkflowArtifactDef ¶ added in v1.3.24
type WorkflowArtifactDef = workflow.ArtifactDef
WorkflowArtifactDef declares a workflow artifact.
type WorkflowSpec ¶ added in v1.3.1
WorkflowSpec is a pack's workflow state-machine specification.
type WorkflowState ¶ added in v1.3.1
WorkflowState is a single state within a workflow.
type WorkflowValidationError ¶ added in v1.3.1
WorkflowValidationError represents a workflow section validation error with details.
func (*WorkflowValidationError) Error ¶ added in v1.3.1
func (e *WorkflowValidationError) Error() string